Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

refactored version display

  • Loading branch information...
commit cea6c1153f4608f6ecc3c2d824f5841c7e9c304d 1 parent f1be3e1
@tj authored
Showing with 12 additions and 20 deletions.
  1. +12 −20 bin/n
View
32 bin/n
@@ -73,37 +73,29 @@ display_n_version() {
#
# Display current node --version
+# and others installed.
#
-display_current_version() {
+display_versions() {
+ # Active version
+ local installed
if test `which node`; then
- local version=`node --version`
- echo " * ${version:1:${#version}}"
+ local installed=`node --version`
+ installed=${installed:1:${#installed}}
fi
-}
-#
-# Display installed versions
-#
-
-display_installed_versions() {
+ # Installed versions
for file in $VERSIONS_DIR/*; do
local version=${file##*/}
- echo " - $version"
+ if test $version = $installed; then
+ echo " \033[32m*\033[0m $version"
+ else
+ echo " $version"
+ fi
done
}
#
-# Display current node --version
-# and others installed.
-#
-
-display_versions() {
- display_current_version
- display_installed_versions
-}
-
-#
# Install node <version>
#
Please sign in to comment.
Something went wrong with that request. Please try again.