From 40e434d6b911503275435e4137cafa6cc7fa3b5c Mon Sep 17 00:00:00 2001 From: crater2150 Date: Wed, 19 Jun 2024 12:46:30 +0200 Subject: [PATCH] update: ask to install new scripts --- misc/update | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/misc/update b/misc/update index caf0eb4..12ec194 100755 --- a/misc/update +++ b/misc/update @@ -32,9 +32,24 @@ gitupdate() { if [[ ! $skip ]] then # update scripts check "Updating scripts..." + local pre_update=$(git -C "$SCRIPTS_DIR" show-ref -s HEAD) local result=$(gitupdate "$SCRIPTS_DIR" 2>&1) if [[ $? == 0 ]]; then succeed + + new_scripts=( $(git log --diff-filter=A --name-only --pretty= $pre_update..HEAD) ) + if [[ -n $new_scripts ]]; then + echo "New scripts:" + for script in $new_scripts; do + echo " $script" + done + echo -n "Install new scripts? [y/n]" + if read -q; then + pushd $SCRIPTS_DIR + ./install.sh $new_scripts + popd + fi + fi exec "$0" "${ALL_ARGS[@]}" --skip-scripts else fail "error during script updates"