Fix script downloading old helper scripts

This commit is contained in:
Jiří Štefka 2023-02-27 02:48:05 +01:00
parent 58edc3ee22
commit 0f1e4b2562
2 changed files with 7 additions and 6 deletions

@ -1,3 +1,3 @@
#!/bin/bash #!/bin/bash
EXTRA_SCRIPTS_VERSION="v1.1.4" EXTRA_SCRIPTS_VERSION="v1.1.5"

@ -8,7 +8,7 @@ set -e
# and acknowledge the original script and author. # # and acknowledge the original script and author. #
############################################################################################################# #############################################################################################################
CURRENT_SCRIPT_VERSION="v1.1.4" CURRENT_SCRIPT_VERSION="v1.1.5"
# -------------------------------------------------- # --------------------------------------------------
# You shouldn't need to change anything in this file # You shouldn't need to change anything in this file
@ -207,7 +207,7 @@ function helper_scripts_update {
# Download matching version of helper scripts # Download matching version of helper scripts
echo "Updating helper scripts..." echo "Updating helper scripts..."
# Download the file into ms-man-helper.tar.gz # Download the file into ms-man-helper.tar.gz
if [[ $(curl -sLJ -w '%{http_code}\n' "https://github.com/jiriks74/msman.sh/releases/download/v1.0.0/ms-man-helper.tar.gz" -o msman-helper.tar.gz) == 200 ]]; then if [[ $(curl -sLJ -w '%{http_code}\n' "https://github.com/jiriks74/msman.sh/releases/download/$CURRENT_SCRIPT_VERSION/ms-man-helper.tar.gz" -o msman-helper.tar.gz) == 200 ]]; then
# Extract the files from ms-man-helper.tar.gz # Extract the files from ms-man-helper.tar.gz
tar -xzf msman-helper.tar.gz tar -xzf msman-helper.tar.gz
# Remove the old script # Remove the old script
@ -244,9 +244,10 @@ function self_update {
rm msman.sh rm msman.sh
echo "Removed old script" echo "Removed old script"
fi fi
echo "Moving new script into place..."
# Rename the new script # Rename the new script
mv msman_new.sh msman.sh mv msman_new.sh msman.sh
echo "Renamed new script" echo "Moved new script into place"
echo "Script updated successfully." echo "Script updated successfully."
echo echo
else else
@ -318,7 +319,7 @@ function check_self_update {
self_update self_update
CURRENT_VERSION=$LATEST_SCRIPT_VERSION CURRENT_VERSION=$LATEST_SCRIPT_VERSION
check_helper_scripts check_helper_scripts
bash -c $(pwd)/msman.sh bash -c "$(pwd)/msman.sh"
else else
echo "Skipping update." echo "Skipping update."
return return
@ -465,7 +466,7 @@ if [[ "$1" == "--redownload" ]] || [[ "$1" == "-r" ]]; then
get_latest_script_release get_latest_script_release
self_update self_update
# Reload the script # Reload the script
bash -c $(pwd)/msman.sh bash -c "$(pwd)/msman.sh"
exit 0 exit 0
elif [[ "$1" == "--edit-config" ]] || [[ "$1" == "-e" ]]; then elif [[ "$1" == "--edit-config" ]] || [[ "$1" == "-e" ]]; then
if ! command -v $EDITOR &> /dev/null; then if ! command -v $EDITOR &> /dev/null; then