Adding all and update functions to installer script

This commit is contained in:
Alex Epstein 2017-06-27 22:24:43 -04:00
parent a0e0eebc30
commit a3cfea00ec
2 changed files with 52 additions and 0 deletions

View File

@ -107,6 +107,15 @@ Quick search that grabs relevant information about a movie
```
this will let you choose which scripts to install
* Install all the scripts
```bash
./install.sh all
```
* Install an individual script
```bash
./install.sh stocks
```
## Uninstalling
* If you don't have the Bash-Snippets folder anymore clone the repository: ```git clone https://github.com/alexanderepstein/Bash-Snippets```

View File

@ -74,6 +74,49 @@ elif [[ $1 == "movies" ]]; then
cd movies || exit 1
./install.sh || exit 1
cd .. || exit 1
elif [[ $1 == "all" ]];then
cd currency || exit 1
./install.sh || exit 1
cd .. || exit 1
cd stocks || exit 1
./install.sh || exit 1
cd .. || exit 1
cd weather || exit 1
./install.sh || exit 1
cd .. || exit 1
cd crypt || exit 1
./install.sh || exit 1
cd .. || exit 1
cd movies || exit 1
./install.sh || exit 1
cd .. || exit 1
elif [[ $1 == "update" ]]; then
echo "Updating scripts..."
if [[ -f /usr/local/bin/currency ]];then
cd currency || exit 1
./install.sh || exit 1
cd .. || exit 1
fi
if [[ -f /usr/local/bin/stocks ]];then
cd stocks || exit 1
./install.sh || exit 1
cd .. || exit 1
fi
if [[ -f /usr/local/bin/weather ]];then
cd weather || exit 1
./install.sh || exit 1
cd .. || exit 1
fi
if [[ -f /usr/local/bin/crypt ]];then
cd crypt || exit 1
./install.sh || exit 1
cd .. || exit 1
fi
if [[ -f /usr/local/bin/movies ]];then
cd movies || exit 1
./install.sh || exit 1
cd .. || exit 1
fi
fi
echo "Bash Snippets version $currentVersion"