-
Notifications
You must be signed in to change notification settings - Fork 1
/
install
executable file
·26 lines (21 loc) · 1.05 KB
/
install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash
# Check if nvm is installed
if [ ! -d "$HOME/.nvm" ]; then echo >&2 "nvm is required, but it's not installed. Aborting."; exit 1; fi
# command -v nvm >/dev/null 2>&1 || { echo >&2 "nvm is required, but it's not installed. Aborting."; exit 1; }
# Make NVM available for script use
export NVM_DIR=$HOME/.nvm;
source $NVM_DIR/nvm.sh;
# Recieved terminal argument
args=$1
if [ "$args" == "re-install" ] ; then
yes | npm i && cd app && nvm use && npm i && cd ../resfulservice && nvm use && npm i && cd .. && docker compose up
echo "Completed '$args' successfully!"
exit
elif [ "$args" == "install" ] ; then
# Compose V1 is no longer supported and will be removed from Docker Desktop in an upcoming release.
# See https://docs.docker.com/go/compose-v1-eol/
yes | rm -rf node_modules && npm i && cd app && rm -rf node_modules && nvm use && npm i && cd ../resfulservice && rm -rf node_modules && nvm use && npm i && cd .. && docker system prune -a && docker compose build
echo "Completed '$args' successfully!"
exit
fi
echo 'Did not understand args', "$args"