mirror of
https://github.com/actuallymentor/battery.git
synced 2026-02-03 05:53: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
|
||||
fi
|
||||
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
|
||||
exit 0
|
||||
fi
|
||||
|
||||
@@ -24,12 +24,9 @@ chown $USER $binfolder/battery
|
||||
chmod 755 $binfolder/battery
|
||||
chmod u+x $binfolder/battery
|
||||
|
||||
echo "[ 3 ] Updating visudo declarations"
|
||||
$binfolder/battery visudo
|
||||
|
||||
# Remove tempfiles
|
||||
cd
|
||||
rm -rf $tempfolder
|
||||
echo "[ 4 ] Removed temporary folder"
|
||||
echo "[ 3 ] Removed temporary folder"
|
||||
|
||||
echo -e "\n🎉 Battery tool updated.\n"
|
||||
|
||||
Reference in New Issue
Block a user