Skip to content

Commit

Permalink
Merge pull request #1634 from uProxy/better-setup-sh
Browse files Browse the repository at this point in the history
Make the setup.sh script more robust
  • Loading branch information
jpevarnek committed Jun 22, 2015
2 parents 0b9fe99 + 4d568ef commit 410c983
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"fs-extra": "^0.12.0",
"grunt": "^0.4.2",
"grunt-browserify": "^3.3.1",
"grunt-cli": "^0.1.13",
"grunt-contrib-clean": "^0.6.0",
"grunt-contrib-copy": "^0.8.0",
"grunt-contrib-jasmine": "^0.8.0",
Expand All @@ -53,8 +54,5 @@
"peerDependencies": {
"freedom": "^0.6.18"
},
"scripts": {
"install": "./node_modules/.bin/bower install"
},
"private": true
}
9 changes: 5 additions & 4 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# allows script to be run from different directories but always act on the
# directory of the project (which is where this script is located).
ROOT_DIR="$(cd "$(dirname $0)"; pwd)";
NPM_BIN_DIR="$ROOT_DIR/node_modules/.bin"

# A simple bash script to run commands to setup and install all dev dependencies
# (including non-npm ones)
Expand All @@ -27,7 +28,7 @@ function runCmd ()

function clean ()
{
runCmd "rm -r $ROOT_DIR/node_modules $ROOT_DIR/build $ROOT_DIR/.tscache"
runCmd "rm -rf $ROOT_DIR/node_modules $ROOT_DIR/build $ROOT_DIR/.tscache"
}

function installTools ()
Expand All @@ -38,9 +39,9 @@ function installTools ()

function installThirdParty ()
{
runAndAssertCmd "bower install --allow-root"
runAndAssertCmd "node_modules/.bin/tsd reinstall --config ./third_party/tsd.json"
runAndAssertCmd "grunt copy:thirdParty"
runAndAssertCmd "$NPM_BIN_DIR/bower install --allow-root"
runAndAssertCmd "$NPM_BIN_DIR/tsd reinstall --config ./third_party/tsd.json"
runAndAssertCmd "$NPM_BIN_DIR/grunt copy:thirdParty"
}

function installDevDependencies ()
Expand Down

0 comments on commit 410c983

Please sign in to comment.