-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7fd4016
commit 1d80fd4
Showing
10 changed files
with
90 additions
and
14 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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,66 @@ | ||
#!/bin/sh | ||
set -e | ||
# Install node and npm via nvm - https://github.com/nvm-sh/nvm | ||
|
||
# Run this script like - bash script-name.sh | ||
|
||
# Define versions | ||
INSTALL_NODE_VER=16 | ||
INSTALL_NVM_VER=0.39.1 | ||
|
||
# You can pass argument to this script --version 8 | ||
if [ "$1" = '--version' ]; then | ||
echo "==> Using specified node version - $2" | ||
INSTALL_NODE_VER=$2 | ||
fi | ||
|
||
echo "==> Ensuring .bashrc exists and is writable" | ||
touch ~/.bashrc | ||
|
||
echo "==> Installing node version manager (NVM). Version $INSTALL_NVM_VER" | ||
# Removed if already installed | ||
rm -rf ~/.nvm | ||
# Unset exported variable | ||
export NVM_DIR= | ||
|
||
# Install nvm | ||
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v$INSTALL_NVM_VER/install.sh | bash | ||
# Make nvm command available to terminal | ||
source ~/.nvm/nvm.sh | ||
|
||
echo "==> Installing node js version $INSTALL_NODE_VER" | ||
nvm install $INSTALL_NODE_VER | ||
|
||
echo "==> Make this version system default" | ||
nvm alias default $INSTALL_NODE_VER | ||
nvm use default | ||
|
||
#echo -e "==> Update npm to latest version, if this stuck then terminate (CTRL+C) the execution" | ||
npm install -g npm | ||
|
||
echo "==> Checking for versions" | ||
nvm --version | ||
node --version | ||
npm --version | ||
|
||
echo "==> Print binary paths" | ||
which npm | ||
which node | ||
|
||
echo "==> List installed node versions" | ||
nvm ls | ||
|
||
nvm cache clear | ||
echo "==> Now you're all setup and ready for development. If changes are yet to take effect in the current shell, try source ~/.bashrc or open a new shell" | ||
|
||
echo "==> Installing oh cli" | ||
npm i -g hzn-cli | ||
|
||
echo "==> Checking oh version" | ||
oh --version | ||
|
||
echo "==> Setting up hzn environment" | ||
oh deploy setup | ||
|
||
# Tested on Ubuntu, MacOS | ||
# @playground |
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
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