From 977a30e752be201670d7ae427e242a2969284364 Mon Sep 17 00:00:00 2001 From: Ascended Date: Wed, 14 Sep 2022 17:11:10 -0500 Subject: [PATCH] Prompt user if they want to restore changes - After stashing any changes and pulling updates, ask user if they wish to pop changes - If user declines the restore, drop the stash to prevent the case of an ever growing stash pile --- update_to_latest.cmd | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/update_to_latest.cmd b/update_to_latest.cmd index 8ed32e376..38f9f6eea 100644 --- a/update_to_latest.cmd +++ b/update_to_latest.cmd @@ -36,7 +36,18 @@ IF "%v_conda_path%"=="" ( echo Stashing local changes and pulling latest update... call git stash call git pull -echo If you want to restore changes you made before updating, run "git stash pop". +set /P restore="Do you want to restore changes you made before updating? (Y/N): " +IF "%restore%" == "N" ( + echo Removing changes please wait... + call git stash drop + echo Changes removed, press any key to continue... + pause >nul +) ELSE IF "%restore%" == "Y" ( + echo Restoring changes, please wait... + call git stash pop --quiet + echo Changes restored, press any key to continue... + pause >nul +) call "%v_conda_path%\Scripts\activate.bat" for /f "delims=" %%a in ('git log -1 --format^="%%H" -- environment.yaml') DO set v_cur_hash=%%a