Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

executable file 37 lines (31 sloc) 0.992 kb
#!/bin/sh -e
# `./build.sh` generates dist/$VERSION.tar.gz
# `./build.sh --install` installs into ~/Library/Application Support/Pow/Current
VERSION=$(node -e 'JSON.parse(require("fs").readFileSync("package.json","utf8")).version')
ROOT="/tmp/pow-build.$$"
DIST="$(pwd)/dist"
cake build
mkdir -p "$ROOT/$VERSION/node_modules"
cp -R package.json bin lib "$ROOT/$VERSION"
cp -R node_modules/ndns "$ROOT/$VERSION/node_modules"
cd "$ROOT/$VERSION"
npm install >/dev/null
cp `which node` bin
if [ "$1" == "--install" ]; then
POW_ROOT="$HOME/Library/Application Support/Pow"
rm -fr "$POW_ROOT/Versions/9999.0.0"
mkdir -p "$POW_ROOT/Versions"
cp -R "$ROOT/$VERSION" "$POW_ROOT/Versions/9999.0.0"
rm -f "$POW_ROOT/Current"
cd "$POW_ROOT"
ln -s Versions/9999.0.0 Current
echo "$POW_ROOT/Versions/9999.0.0"
else
cd "$ROOT"
tar czf "$VERSION.tar.gz" "$VERSION"
mkdir -p "$DIST"
cd "$DIST"
mv "$ROOT/$VERSION.tar.gz" "$DIST"
echo "$DIST/$VERSION.tar.gz"
fi
rm -fr "$ROOT"
Jump to Line
Something went wrong with that request. Please try again.