Added option to postpone an update

This commit is contained in:
Thomas Forgione 2019-05-28 07:32:11 +02:00
parent d666330b67
commit 045373edcd
No known key found for this signature in database
GPG Key ID: BFD17A2D71B3B5E7
1 changed files with 12 additions and 6 deletions

View File

@ -263,6 +263,15 @@ update-neovim() {
echo -e "\033[32;1m=== Neovim updated in $formatted ===\033[0m"
}
update-postpone() {
local format=`_date_format`
if [ $? -eq 0 ]; then
_check_date_file
date $format > ~/.config/dotfiles/.data/update_date
fi
}
_print_help() {
echo
}
@ -276,6 +285,7 @@ partial-test() {
"neovim") return 0;;
"check") return 0;;
"startup") return 0;;
"postpone") return 0;;
*) return 1;;
esac
}
@ -289,6 +299,7 @@ partial-update() {
"neovim") update-neovim;;
"check") _check_date_if_format force;;
"startup") _check_date_if_format;;
"postpone") update-postpone;;
*) return 1
esac
}
@ -315,12 +326,7 @@ main() {
# Update the neovim packages
update-neovim
format=`_date_format`
if [ $? -eq 0 ]; then
_check_date_file
date $format > ~/.config/dotfiles/.data/update_date
fi
update-postpone
seconds=$((`date +%s` - $start ))
formatted=`date -ud "@$seconds" +'%H hours %M minutes %S seconds'`