Skip to content

Commit

Permalink
Fix install.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
just-do-halee committed Feb 17, 2023
1 parent d6e5f11 commit 3df0852
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@
```shell
curl -Ss https://raw.githubusercontent.com/just-do-halee/near-contract/main/install.sh | sh
```
```shell
make # after installation
```
49 changes: 49 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,52 @@ rm -rf .git

rm LICENSE
rm LICENSE-APACHE

if [[ "$OSTYPE" == "msys" || "$OSTYPE" == "cygwin" ]]; then
# Windows with Cygwin or MSYS2
NULPATH=NUL
else
NULPATH=/dev/null
fi

# git init

git --version > $NULPATH
if [[ $? == 0 ]]; then
git init
fi

# RUST

rustup --help > $NULPATH
if [[ $? != 0 ]]; then
# if there is no rustup, install it
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
else
# there is rustup, so update it
rustup update
fi

# NPM

npm --version > $NULPATH
if [[ $? != 0 ]]; then
# if there is no npm, install it
curl -L https://www.npmjs.com/install.sh | sh
else
# there is npm, so update it
npm install -g npm
fi

# NEAR

near --help > $NULPATH
if [[ $? != 0 ]]; then
# if there is no near, install it
npm install -g near-cli
else
# there is near, so update it
npm update -g near-cli
fi

near login

0 comments on commit 3df0852

Please sign in to comment.