Skip to content

Commit

Permalink
update demeteorizer, node, and npm
Browse files Browse the repository at this point in the history
  • Loading branch information
theworkflow committed Aug 4, 2016
1 parent 794bd46 commit 45275bd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
20 changes: 8 additions & 12 deletions bin/build
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
set -e

CURRENT_DIR=$(pwd)
COMMAND=''
DEFAULT_COMMAND=$(demeteorizer --server-only --output $OUTPUT_DIR)

if [[ ! $INPUT_DIR ]] || [[ ! $OUTPUT_DIR ]]; then
printf "Input/Output directory variables must be set.\n"
Expand Down Expand Up @@ -46,21 +44,19 @@ printf "Using $METEOR_VERSION.\n"
FLAGS="--server-only --output $OUTPUT_DIR"

if [[ $NPM ]]; then
printf "NPM version $NPM specified.\n"
FLAGS="$FLAGS --npm-version $NPM"
fi

if [[ $NODE ]]; then
printf "Node version $NODE specified.\n"
FLAGS="$FLAGS --node-version $NODE"
fi

if [[ $DEBUG ]]; then
FLAGS="$FLAGS --debug"
fi

cd $INPUT_DIR
METEOR_VERSION=$(cat $INPUT_DIR/.meteor/release)
printf "Using $METEOR_VERSION.\n"

demeteorizer $FLAGS

# Searches a directory top-down looking for a file.
Expand All @@ -79,16 +75,20 @@ export PACKAGE_PATH
NODE_VERSION=$(get-version --engine node $PACKAGE_PATH 2>/dev/null) || true
NPM_VERSION=$(get-version --engine npm $PACKAGE_PATH 2>/dev/null) || true

if [[ $NODE_VERSION ]] && [[ 'v$NODE_VERSION' != $(node -v) ]]; then
if [[ 'v$NODE_VERSION' != $(node -v) ]]; then
nvm install $NODE_VERSION > /dev/null 2>&1
fi

if [[ $NPM_VERSION ]]; then
if [[ $NPM_VERSION != $(npm -v) ]]; then
npm install npm@$NPM_VERSION --global > /dev/null 2>&1
fi

nvm alias deploy $(nvm current)

if [[ $NPM_USER ]] && [[ $NPM_PASSWORD ]] && [[ $NPM_EMAIL ]]; then
npm-login
fi

if [[ -f $INPUT_DIR/package.json ]]; then
printf "Installing root package.json dependencies.\n"
npm install --production
Expand All @@ -98,8 +98,4 @@ if [[ -d $INPUT_DIR/node_modules ]]; then
mv $INPUT_DIR/node_modules $OUTPUT_DIR
fi

if [[ $NPM_USER ]] && [[ $NPM_PASSWORD ]] && [[ $NPM_EMAIL ]]; then
npm-login
fi

npm-install
6 changes: 3 additions & 3 deletions bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ export TMP_DIR=/tmp
# Other environment variables
export NVM_DIR=/opt/nvm
export PROFILE=$HOME/.profile
export DEMETEORIZER_VERSION=3.1.0
export NODE_VERSION=0.10.41
export NPM_VERSION=3.9.6
export DEMETEORIZER_VERSION=4.0.0
export NODE_VERSION=4.4.7
export NPM_VERSION=3.10.5

# Create $HOME/.profile and export environment variable
if [[ ! -d $HOME ]]; then
Expand Down

0 comments on commit 45275bd

Please sign in to comment.