Skip to content

Commit

Permalink
better npm support
Browse files Browse the repository at this point in the history
  • Loading branch information
ddollar committed Jan 11, 2012
1 parent 404494b commit aa480b1
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions bin/compile
Original file line number Diff line number Diff line change
Expand Up @@ -64,23 +64,37 @@ export CPATH="$INCLUDE_PATH"
export CPPPATH="$INCLUDE_PATH"

# unpack existing cache
rm -rf $CACHE_TARGET_DIR
if [ -d $CACHE_STORE_DIR ]; then
cp -a $CACHE_STORE_DIR $CACHE_TARGET_DIR
mkdir -p $CACHE_TARGET_DIR
cp -R $CACHE_STORE_DIR/* $CACHE_TARGET_DIR/
fi

# install dependencies with npm
echo "-----> Installing dependencies with npm $NPM_VERSION"
cd $BUILD_DIR

HOME="$BUILD_DIR" $VENDORED_NODE/bin/node $VENDORED_NPM/cli.js prune 2>&1 | indent

if [ "${PIPESTATUS[*]}" != "0 0" ]; then
echo " ! Failed to prune dependencies with npm"
exit 1
fi

HOME="$BUILD_DIR" $VENDORED_NODE/bin/node $VENDORED_NPM/cli.js install 2>&1 | indent

if [ "${PIPESTATUS[*]}" != "0 0" ]; then
echo " ! Failed to install dependencies with npm"
exit 1
else
echo " Dependencies installed"
fi

HOME="$BUILD_DIR" $VENDORED_NODE/bin/node $VENDORED_NPM/cli.js rebuild 2>&1 | indent

if [ "${PIPESTATUS[*]}" != "0 0" ]; then
echo " ! Failed to rebuild dependencies with npm"
exit 1
fi
echo " Dependencies installed"

# repack cache with new assets
if [ -d $CACHE_TARGET_DIR ]; then
rm -rf $CACHE_STORE_DIR
Expand Down

0 comments on commit aa480b1

Please sign in to comment.