Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 27 additions & 1 deletion public/template.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,40 @@ THIS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
CONFIGURATION_FILE_PATH=~/.choco-scripts.cfg
SCRIPT_DESCRIPTION=""

#
# Installs choco-scripts
#
function installChocoScripts()
{
echo "Installation of the choco-scripts"

# This line installs wget tool - you don't need to use it if you already have it
apt-get update && apt-get install -y wget

# This downloads an installation script and run it
wget -O - https://release.choco-technologies.com/scripts/install-choco-scripts.sh | bash
}

#
# Verification of the choco scripts installation
#
if [ -f "$CONFIGURATION_FILE_PATH" ]
then
source $CONFIGURATION_FILE_PATH
else
printf "\033[31;1mChoco-Scripts are not installed for this user\033[0m\n"
printf "\033[31;1mChoco-Scripts are not installed for this user\033[0m\n\n"
printf " \033[37;1mYou can find the installation instruction here: \033[0m\n"
printf " \033[34;1mhttps://bitbucket.org/chocotechnologies/scripts/src/master/\033[0m\n\n"

while true
do
read -p "Do you want to try to auto-install it? [Y/n]: " answer
case $answer in
[Yy]* ) installChocoScripts; break;;
[Nn]* ) echo "Skipping installation"; exit 1;;
* ) echo "Please answer Y or n";;
esac
done
exit 1
fi

Expand Down