Skip to content

Commit

Permalink
chore(install): reintroduce single install script
Browse files Browse the repository at this point in the history
closes angular#1900
This single install script:
- Checks for the proper version of node (some of us develop with node
v4 on other sites, and it is too easy to forget to switch to v5 for
angular.io).
- Applies the patch (that is necessary to support harp compilation of
Dart API pages).
  • Loading branch information
chalin authored and wardbell committed Jul 17, 2016
1 parent a19c2ce commit daca93c
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
31 changes: 31 additions & 0 deletions scripts/install.sh
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit daca93c

Please sign in to comment.