mirror of
https://github.com/msmhq/msm.git
synced 2024-08-30 18:12:35 +00:00
Improve update cleanup to prevent auth messages after every command
This commit is contained in:
parent
7affffda32
commit
04a30f4b31
14
init/msm
14
init/msm
@ -1982,6 +1982,14 @@ command_update() {
|
||||
# Create the temp download directory
|
||||
local output_dir="/tmp/msmupdate"
|
||||
|
||||
# Clean up the temp directory created for downloads
|
||||
cleanup() {
|
||||
as_user "$SETTINGS_USERNAME" "rm -rf \"${output_dir}\""
|
||||
}
|
||||
|
||||
# Remove the directory if it exists already
|
||||
cleanup
|
||||
|
||||
# $1: The file name to download
|
||||
download_file() {
|
||||
local dir_name="$(dirname "${output_dir}/${1}")"
|
||||
@ -2235,6 +2243,8 @@ command_update() {
|
||||
echo "MSM was not updated."
|
||||
fi
|
||||
|
||||
cleanup
|
||||
|
||||
# This script will now be replaced. So run the new script's
|
||||
# update code, incase there are new things to update that
|
||||
# this version of MSM does not know about yet.
|
||||
@ -3764,10 +3774,6 @@ interrupt() {
|
||||
fi
|
||||
done
|
||||
|
||||
# Clean up the temp directory created for downloads
|
||||
manager_property USERNAME
|
||||
as_user "$SETTINGS_USERNAME" "rm -rf \"${output_dir}\""
|
||||
|
||||
exit
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user