Skip to content

Instantly share code, notes, and snippets.

@kriskowal
Forked from paulbaumgart/narwhal-node.sh
Created August 7, 2010 19:40
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kriskowal/513111 to your computer and use it in GitHub Desktop.
Save kriskowal/513111 to your computer and use it in GitHub Desktop.
#/usr/bin/env sh
check_and_exit () {
if [ ! "$?" = "0" ]; then
echo "$1"
exit 1
fi
}
# Node.JS
if [ ! -d node ]; then
git clone git://github.com/ry/node.git
check_and_exit "Error cloning Node.JS."
pushd node
git checkout v0.1.95
check_and_exit "Error checking out v0.1.95 of Node.JS."
./configure
check_and_exit "Error compiling Node.JS."
make
check_and_exit "Error compiling Node.JS."
sudo make install
check_and_exit "Error installing Node.JS."
popd
fi
# kriskowal's Narwhal
if [ ! -d narwhal ]; then
git clone git://github.com/kriskowal/narwhal.git
check_and_exit "Error cloning Narwhal."
pushd narwhal
git checkout origin/future
check_and_exit "Error installing Narwhal."
else
pushd narwhal
fi
# narwhal-node
if [ ! -d packages/narwhal-node ]; then
pushd packages
git clone git://github.com/kriskowal/narwhal-node.git
check_and_exit "Error cloning narwhal-node."
pushd narwhal-node
make
check_and_exit "Error compiling narwhal-node."
popd
popd
fi
# set up env
echo NARWHAL_ENGINE=node >> narwhal.conf
echo NARWHAL_ENGINE_HOME=packages/narwhal-node >> narwhal.conf
source bin/activate
js examples/hello
check_and_exit "Error installing narwhal-node."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment