forked from PolymerLabs/arcs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Easy Install Method (PolymerLabs#3387)
* automated setup process - converted fresh install instructions into bash script - tested on Linux * renamed to setup.sh * updated setup - changed shebang - moved to tools * updated setup - fixed paths for tools dir - tested on linux machine; works fine * Updated readme with new install mechanism * echo-ing to indicate progress * added tracing for failures * got tracing + early exiting working * added whitespace for better tracing * try all sourcing strategies... * better cmd to get latest npm version * no hardcoded node version * cleaned up setup - rm last step (will print options for user later) - fixed issue: didn't install nvmrc before using it's value - formatting * added coloring + next steps * better whitespace * preferring npm ci instead of install - should be faster than npm install * better verbage * stated target OS
- Loading branch information
Showing
3 changed files
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
v10.16.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/bin/sh | ||
|
||
ROOT=$(dirname $0)/.. | ||
|
||
NVM_VERSION="v0.34.0" | ||
|
||
YLW="\033[33m" | ||
RED="\033[91m" | ||
GRN="\033[92m" | ||
MAG="\033[95m" | ||
BLD="\033[1m" | ||
END="\033[0m" | ||
|
||
CMD="$BLD$YLW" | ||
|
||
|
||
fail() { | ||
echo "$RED$BLD$1$END" | ||
exit 1 | ||
} | ||
|
||
status() { | ||
echo "$MAG$1$END" | ||
} | ||
|
||
status "1. Install nvm" | ||
curl -o- "https://raw.githubusercontent.com/creationix/nvm/$NVM_VERSION/install.sh" | sh || \ | ||
fail "Failed to download nvm version $NVM_VERSION." | ||
|
||
status "1.1 ensure nvm is in your current process" | ||
. ~/.nvm/nvm.sh || source ~/.nvm/nvm.sh | ||
|
||
status "2. Install node" | ||
(cd $ROOT && nvm install && nvm use) || fail 'Failed to install target node version.' | ||
|
||
status "3. Update npm to latest version" | ||
nvm install-latest-npm || fail 'Failed to update npm to latest version.' | ||
|
||
status "4. Install dependencies" | ||
(cd $ROOT && npm ci) || fail 'Failed to install dependencies.' | ||
|
||
|
||
echo "$GRN$BLD\n\nSETUP COMPLETE\n$END" | ||
echo "Next, try the following:\n" | ||
echo "- Setup git hooks: $CMD\`git config core.hooksPath tools/hooks\`$END" | ||
echo "- Serve the project: $CMD\`npm start\`$END" | ||
echo "- Run tests:" | ||
echo " - $CMD\`./tools/sigh test\`$END" | ||
echo " - $CMD\`./tools/test\`$END" | ||
|