Permalink
Browse files

installing

  • Loading branch information...
1 parent d3ac35d commit 3017360ba7dcdd0de756b2dc8f501b1e8d2f3169 @tj committed Jan 5, 2011
Showing with 24 additions and 0 deletions.
  1. +24 −0 bin/n
View
24 bin/n
@@ -60,6 +60,29 @@ display_n_version() {
echo $VERSION && exit 0
}
+#
+# Install node <version>
+#
+
+install_node() {
+ local version=$1
+
+ # remove "v"
+ if test "${version:0:1}" = "v"; then
+ version=${version:1:${#version}}
+ fi
+
+ log "installing $version"
+ cd /tmp \
+ && $GET "http://nodejs.org/dist/node-v$version.tar.gz" \
+ > "node-v$version.tar.gz" \
+ && tar -zxf "node-v$version.tar.gz" \
+ && cd "node-v$version" \
+ && ./configure
+ && make install
+ && log "installation complete"
+}
+
# Handle arguments
if test $# -eq 0; then
@@ -69,6 +92,7 @@ else
case $1 in
-V|--version) display_n_version ;;
-h|--help) display_help ;;
+ *) install_node $1 ;;
esac
shift
done

0 comments on commit 3017360

Please sign in to comment.