Skip to content

Commit

Permalink
Update the installer to work with $NODE_PATH
Browse files Browse the repository at this point in the history
  • Loading branch information
creationix committed Apr 26, 2010
1 parent a883ffa commit 9af44d2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion bin/wheat
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var Wheat = require('wheat');
var sys = require('sys');
var path = process.argv[2] || process.cwd();
var port = 8080;
var host
var host;
if (port = process.argv[3]) {
if (/^[0-9]+$/.test(port)) {
port = parseInt(port);
Expand Down
21 changes: 14 additions & 7 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,21 @@ echo
echo "Loading dependencies as git submodules..."
git submodule init
git submodule update
if [ ! -n "$NODE_PATH" ]; then
NODE_PATH="$HOME/.node_libraries"
fi
if [ ! -d $NODE_PATH ]; then
echo
echo "Creating $NODE_PATH folder"
mkdir -p "$NODE_PATH"
fi
echo
echo "Creating ~/.node_libraries folder if it doesn't exist yet..."
mkdir -p ~/.node_libraries
echo
echo "Linking current working copy into the .node_libraries folder..."
ln -sf `pwd`/lib/wheat.js ~/.node_libraries/wheat.js
rm ~/.node_libraries/wheat
ln -s `pwd`/lib/wheat ~/.node_libraries/wheat
echo "Linking current working copy into the $NODE_PATH folder..."
ln -sf `pwd`/lib/wheat.js $NODE_PATH/wheat.js
if [ -d $NODE_PATH/wheat ]; then
rm -rf $NODE_PATH/wheat
fi
ln -s `pwd`/lib/wheat $NODE_PATH/wheat
echo "Linking wheat binary to ~/bin..."
mkdir -p ~/bin
ln -sf `pwd`/bin/wheat ~/bin/wheat
Expand Down

0 comments on commit 9af44d2

Please sign in to comment.