From 8aed84f17f8f293963518ac5af824c16d65e10da Mon Sep 17 00:00:00 2001 From: Patryk Kubiak Date: Wed, 22 Jun 2022 19:04:37 +0200 Subject: [PATCH 1/3] #53 - Update template to include auto-installation of the choco-scripts reopen #53 Changes: - Added auto-installation to the template Signed-by: Patryk Kubiak --- public/template.sh | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/public/template.sh b/public/template.sh index d3b48b8..59f84eb 100755 --- a/public/template.sh +++ b/public/template.sh @@ -15,6 +15,20 @@ 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 # @@ -22,7 +36,19 @@ 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 From 0187261fa0b9c0fa85f85af87f762ed62a5499fa Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 1 Mar 2026 15:48:47 +0000 Subject: [PATCH 2/3] Initial plan From a408bd3541860e564db5e75389754074c27c4694 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 1 Mar 2026 15:52:07 +0000 Subject: [PATCH 3/3] Update expired URLs to raw GitHub/GitHub releases Co-authored-by: JohnAmadis <17320783+JohnAmadis@users.noreply.github.com> --- README.md | 2 +- install-choco-scripts.sh | 5 +++-- public/template.sh | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 68cab36..3ef091d 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ You can use the following command to install it in your enviroment: sudo 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 +wget -O - https://raw.githubusercontent.com/JohnAmadis/choco-scripts/main/install-choco-scripts.sh | bash ``` Once the scripts are installed, they are auto-loaded on bash start and you can start using it. To import it in your script, just add the following line into your project: diff --git a/install-choco-scripts.sh b/install-choco-scripts.sh index 7384ad0..dbe21cb 100755 --- a/install-choco-scripts.sh +++ b/install-choco-scripts.sh @@ -7,9 +7,10 @@ # PROJECT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" +GITHUB_REPO=JohnAmadis/choco-scripts VERSION=latest FILE_NAME=choco-scripts-$VERSION.tar.gz -URL=http://release.choco-technologies.com/scripts/$FILE_NAME +URL=https://github.com/$GITHUB_REPO/releases/latest/download/$FILE_NAME TARGET_PATH=~/.choco-scripts TEMPLATE_FILE_NAME=template.sh TEMPLATE_FILE_PATH=$TARGET_PATH/$TEMPLATE_FILE_NAME @@ -20,7 +21,7 @@ CHOCO_HELP_FILE_PATH=$TARGET_PATH/$CHOCO_HELP_FILE_NAME USER_CONFIG_PATH=~/.choco-scripts.cfg BASHRC_FILE_PATH=~/.bashrc ENTRY_SCRIPT_NAME=choco-scripts -INSTALL_URL=https://release.choco-technologies.com/scripts/install-choco-scripts.sh +INSTALL_URL=https://raw.githubusercontent.com/$GITHUB_REPO/main/install-choco-scripts.sh if [ "$1" == "--help" ] then diff --git a/public/template.sh b/public/template.sh index 59f84eb..7e6ec8a 100755 --- a/public/template.sh +++ b/public/template.sh @@ -26,7 +26,7 @@ function installChocoScripts() 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 + wget -O - https://raw.githubusercontent.com/JohnAmadis/choco-scripts/main/install-choco-scripts.sh | bash } # @@ -38,7 +38,7 @@ then else 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" + printf " \033[34;1mhttps://github.com/JohnAmadis/choco-scripts\033[0m\n\n" while true do