Adding ytview installer and uninstaller pipeline

This commit is contained in:
Alex Epstein 2017-07-03 20:09:22 -04:00
parent 7317fbbe53
commit 89b37e2296
4 changed files with 42 additions and 0 deletions

View File

@ -87,6 +87,15 @@ if [[ $# == 0 ]]; then
cd .. || exit 1
fi
unset answer
echo -n "Do you wish to install ytview [Y/n]: "
read -r answer
if [[ "$answer" == "Y" || "$answer" == "y" ]] ;then
cd ytview || exit 1
./install.sh
cd .. || exit 1
fi
fi
@ -126,6 +135,10 @@ elif [[ $1 == "cheat" ]]; then
cd cheat || exit 1
./install.sh || exit 1
cd .. || exit 1
elif [[ $1 == "ytview" ]]; then
cd ytview || exit 1
./install.sh || exit 1
cd .. || exit 1
elif [[ $1 == "all" ]];then
cd currency || exit 1
./install.sh || exit 1
@ -154,6 +167,9 @@ elif [[ $1 == "all" ]];then
cd cheat || exit 1
./install.sh || exit 1
cd .. || exit 1
cd ytview || exit 1
./install.sh || exit 1
cd .. || exit 1
elif [[ $1 == "update" ]]; then
echo "Updating scripts..."
if [[ -f /usr/local/bin/currency ]];then
@ -201,6 +217,11 @@ elif [[ $1 == "update" ]]; then
./install.sh || exit 1
cd .. || exit 1
fi
if [[ -f /usr/local/bin/ytview ]];then
cd ytview || exit 1
./install.sh || exit 1
cd .. || exit 1
fi
fi
echo "Bash Snippets version $currentVersion"

View File

@ -97,3 +97,13 @@ if [[ -f /usr/local/bin/cheat ]];then
cd .. || exit 1
fi
fi
if [[ -f /usr/local/bin/ytview ]];then
echo -n "Do you wish to uninstall ytview [Y/n]: "
read -r answer
if [[ "$answer" == "Y" || "$answer" == "y" ]] ;then
cd ytview || exit 1
./uninstall.sh
cd .. || exit 1
fi
fi

6
ytview/install.sh Executable file
View File

@ -0,0 +1,6 @@
#!/bin/bash
# Author: Alexander Epstein https://github.com/alexanderepstein
echo -n "Installing ytview: "
chmod a+x ytview
cp ytview /usr/local/bin > /dev/null 2>&1 || { echo "Failure"; echo "Error copying file, try running install script as sudo"; exit 1; }
echo "Success"

5
ytview/uninstall.sh Executable file
View File

@ -0,0 +1,5 @@
#!/bin/bash
# Author: Alexander Epstein https://github.com/alexanderepstein
echo -n "Removing ytview: "
rm -f /usr/local/bin/ytview > /dev/null 2>&1 || { echo "Failed" ; echo "Error removing file, try running uninstall script as sudo"; exit 1; }
echo "Success"