diff --git a/README.md b/README.md index 5522be95c7..2393a19daa 100644 --- a/README.md +++ b/README.md @@ -119,7 +119,7 @@ This project generates a lot of untracked files, if you wish to reset it to a mi Also, there is a script available for Linux, OSX and Windows Gitbash users that will setup the project using the steps shown in this section: -- `npm install --no-optional && ./scripts/examples-install.sh` +- `./scripts/install.sh` ### Run with current build instead of release packages Can switch the `@angular` packages in `~/public/docs/_examples/node_modules` to the current build packages with diff --git a/scripts/install.sh b/scripts/install.sh new file mode 100755 index 0000000000..cc95b6726b --- /dev/null +++ b/scripts/install.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash + +set -e -o pipefail + +cd `dirname $0`/.. + +if [[ "$(node --version)" < "v5" ]]; then + echo "ERROR: bad version of node detected. If you have nvm installed, type:" + echo " nvm use" + echo "Aborting installation." + exit 1; +else + echo "Node version: $(node --version)" +fi + +echo "Installing main packages ..." +npm install --no-optional + +echo "Patching ..." +source ./scripts/patch.sh + +if [ "$TRAVIS" != "true" ]; then + echo "Rebuilding node-sass, just in case ..." + npm rebuild node-sass; +fi + +echo "Installing packages for examples ..." +source ./scripts/examples-install.sh +set +x + +echo "Installation done" \ No newline at end of file