mirror of
https://github.com/actuallymentor/battery.git
synced 2026-02-03 14:03:24 +00:00
Do not invoke battery visudo from update.sh, because it may crash the UI (issue #377)
This commit is contained in:
@@ -509,6 +509,14 @@ if [[ "$action" == "update" ]]; then
|
|||||||
read
|
read
|
||||||
fi
|
fi
|
||||||
curl -sS https://raw.githubusercontent.com/actuallymentor/battery/main/update.sh | bash
|
curl -sS https://raw.githubusercontent.com/actuallymentor/battery/main/update.sh | bash
|
||||||
|
if [[ ! "$setting" == "silent" ]]; then
|
||||||
|
# The setting "silent" is always passed when `battery update` is invoked from the UI app,
|
||||||
|
# which decides whether to invoke `battery visudo` as well. But for Terminal-only users
|
||||||
|
# there is no UI app. So it's either we invoke `battery visudo` here, or assume that users
|
||||||
|
# remember to do it themselves, which did not work in the past.
|
||||||
|
echo "Runnig $battery_binary visudo"
|
||||||
|
$battery_binary visudo
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -24,12 +24,9 @@ chown $USER $binfolder/battery
|
|||||||
chmod 755 $binfolder/battery
|
chmod 755 $binfolder/battery
|
||||||
chmod u+x $binfolder/battery
|
chmod u+x $binfolder/battery
|
||||||
|
|
||||||
echo "[ 3 ] Updating visudo declarations"
|
|
||||||
$binfolder/battery visudo
|
|
||||||
|
|
||||||
# Remove tempfiles
|
# Remove tempfiles
|
||||||
cd
|
cd
|
||||||
rm -rf $tempfolder
|
rm -rf $tempfolder
|
||||||
echo "[ 4 ] Removed temporary folder"
|
echo "[ 3 ] Removed temporary folder"
|
||||||
|
|
||||||
echo -e "\n🎉 Battery tool updated.\n"
|
echo -e "\n🎉 Battery tool updated.\n"
|
||||||
|
|||||||
Reference in New Issue
Block a user