diff --git a/README.md b/README.md index a0b4e4e..d0ee361 100644 --- a/README.md +++ b/README.md @@ -8,3 +8,6 @@ ```shell curl -Ss https://raw.githubusercontent.com/just-do-halee/near-contract/main/install.sh | sh ``` +```shell +make # after installation +``` diff --git a/install.sh b/install.sh index 4ff7566..6ba394d 100644 --- a/install.sh +++ b/install.sh @@ -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