From 178079a39fee5fcce8b6ecc34ef6a99663421890 Mon Sep 17 00:00:00 2001 From: Heavybullets8 Date: Tue, 23 Aug 2022 12:02:41 -0600 Subject: [PATCH] test title release and SU releases --- functions/misc.sh | 1 + functions/self_update.sh | 4 +++- heavy_script.sh | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/functions/misc.sh b/functions/misc.sh index 87278b4b..33b4d4c0 100644 --- a/functions/misc.sh +++ b/functions/misc.sh @@ -31,6 +31,7 @@ echo '| | | | __/ (_| |\ V /| |_| /\__/ / (__| | | | |_) | |_ ' echo '\_| |_/\___|\__,_| \_/ \__, \____/ \___|_| |_| .__/ \__|' echo ' __/ | | | ' echo ' |___/ |_| ' +echo "$hs_version" echo } export -f title diff --git a/functions/self_update.sh b/functions/self_update.sh index 26b2fd56..5df34f34 100644 --- a/functions/self_update.sh +++ b/functions/self_update.sh @@ -16,6 +16,7 @@ if git diff --name-only origin/$branch | grep -qs ".sh" ; then [[ "$i" == "--self-update" ]] && unset "args[$count]" && break ((count++)) done + curl --silent "https://api.github.com/repos/HeavyBullets8/heavy_script/releases/latest" | jq -r .tag_name,.body [[ -z ${args[*]} ]] && echo -e "No more arguments, exiting..\n\n" && exit echo -e "Running the new version...\n\n" sleep 5 @@ -23,7 +24,8 @@ if git diff --name-only origin/$branch | grep -qs ".sh" ; then # Now exit this old instance exit else - echo -e "HeavyScript is already the latest version\n\n" + echo -e "HeavyScript is already the latest version:\n\n" + echo "$hs_version" fi } export -f self_update diff --git a/heavy_script.sh b/heavy_script.sh index fad37d0c..b8878186 100644 --- a/heavy_script.sh +++ b/heavy_script.sh @@ -1,5 +1,7 @@ #!/bin/bash +#Version +hs_version=$(curl --silent "https://api.github.com/repos/HeavyBullets8/heavy_script/releases/latest" | jq -r .tag_name) # cd to script, this ensures the script can find the source scripts below, even when ran from a seperate directory script=$(readlink -f "$0")