Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Displaying installed versions

  • Loading branch information...
commit f1be3e1dc6dbda6edf096a6c8020fe9a93239482 1 parent 3d10d31
@tj authored
Showing with 13 additions and 3 deletions.
  1. +13 −3 bin/n
View
16 bin/n
@@ -78,19 +78,29 @@ display_n_version() {
display_current_version() {
if test `which node`; then
local version=`node --version`
- echo " current: $version"
- else
- echo " current: none"
+ echo " * ${version:1:${#version}}"
fi
}
#
+# Display installed versions
+#
+
+display_installed_versions() {
+ for file in $VERSIONS_DIR/*; do
+ local version=${file##*/}
+ echo " - $version"
+ done
+}
+
+#
# Display current node --version
# and others installed.
#
display_versions() {
display_current_version
+ display_installed_versions
}
#
Please sign in to comment.
Something went wrong with that request. Please try again.