Skip to content

Commit

Permalink
Prompt user if they want to restore changes (#1137)
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
AscendedGravity authored Sep 15, 2022
1 parent f74d796 commit 9fd1f7d
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion update_to_latest.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9fd1f7d

Please sign in to comment.