Skip to content
Browse files

Added check_current_version

  • Loading branch information...
1 parent cea6c11 commit 7dccb39ea39ad36039c4c99ff606ec9f1d7595b7 @tj committed
Showing with 13 additions and 9 deletions.
  1. +13 −9 bin/n
View
22 bin/n
@@ -72,22 +72,26 @@ display_n_version() {
}
#
-# Display current node --version
-# and others installed.
+# Check for installed version, and populate $version
#
-display_versions() {
- # Active version
- local installed
+check_current_version() {
if test `which node`; then
- local installed=`node --version`
+ installed=`node --version`
installed=${installed:1:${#installed}}
- fi
+ fi
+}
- # Installed versions
+#
+# Display current node --version
+# and others installed.
+#
+
+display_versions() {
+ check_current_version
for file in $VERSIONS_DIR/*; do
local version=${file##*/}
- if test $version = $installed; then
+ if test "$version" = "$installed"; then
echo " \033[32m*\033[0m $version"
else
echo " $version"

0 comments on commit 7dccb39

Please sign in to comment.
Something went wrong with that request. Please try again.