self update fix
This commit is contained in:
parent
69258f9af5
commit
0f9469cc3a
@ -9,16 +9,16 @@ if git diff --name-only origin/beta | grep -qs ".sh" ; then
|
|||||||
echo "Found a new version of HeavyScript, updating myself..."
|
echo "Found a new version of HeavyScript, updating myself..."
|
||||||
git reset --hard -q
|
git reset --hard -q
|
||||||
git pull --force -q
|
git pull --force -q
|
||||||
echo -e "Running the new version...\n"
|
|
||||||
count=0
|
count=0
|
||||||
for i in "${args[@]}"
|
for i in "${args[@]}"
|
||||||
do
|
do
|
||||||
[[ "$i" == "--self-update" ]] && unset "args[$count]" && break
|
[[ "$i" == "--self-update" ]] && unset "args[$count]" && break
|
||||||
((count++))
|
((count++))
|
||||||
done
|
done
|
||||||
|
[[ -z ${args[*]} ]] && exit
|
||||||
|
echo -e "Running the new version...\n"
|
||||||
sleep 5
|
sleep 5
|
||||||
exec bash "$script_name" "${args[@]}"
|
exec bash "$script_name" "${args[@]}"
|
||||||
|
|
||||||
# Now exit this old instance
|
# Now exit this old instance
|
||||||
exit
|
exit
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user