Skip to content

Commit 9fd1f7d

Browse files
Prompt user if they want to restore changes (#1137)
- 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
1 parent f74d796 commit 9fd1f7d

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

update_to_latest.cmd

+12-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,18 @@ IF "%v_conda_path%"=="" (
3636
echo Stashing local changes and pulling latest update...
3737
call git stash
3838
call git pull
39-
echo If you want to restore changes you made before updating, run "git stash pop".
39+
set /P restore="Do you want to restore changes you made before updating? (Y/N): "
40+
IF "%restore%" == "N" (
41+
echo Removing changes please wait...
42+
call git stash drop
43+
echo Changes removed, press any key to continue...
44+
pause >nul
45+
) ELSE IF "%restore%" == "Y" (
46+
echo Restoring changes, please wait...
47+
call git stash pop --quiet
48+
echo Changes restored, press any key to continue...
49+
pause >nul
50+
)
4051
call "%v_conda_path%\Scripts\activate.bat"
4152

4253
for /f "delims=" %%a in ('git log -1 --format^="%%H" -- environment.yaml') DO set v_cur_hash=%%a

0 commit comments

Comments
 (0)