From f388f82630d85438fdf4a1bdf73a95b908ff0985 Mon Sep 17 00:00:00 2001 From: Morten Winther Olsson Date: Tue, 3 Apr 2018 22:02:07 +0200 Subject: [PATCH 1/2] Update .bash_profile Check if Visual Studio is running before changing branch in "ch" --- .bash_profile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.bash_profile b/.bash_profile index 12d8608..1318ea1 100644 --- a/.bash_profile +++ b/.bash_profile @@ -92,6 +92,12 @@ function reset { function ch { local doCleanup=true + if [[ `TASKLIST //FI "STATUS eq running" //FI "IMAGENAME eq devenv.exe" //NH` != "INFO: No tasks are running which match the specified criteria." ]] ; + then + echo "Please remember to exit Visual Studio before switching branches." ; + return 2 ; + fi ; + git checkout $1 if [ $? != 0 ] then From be937a4b6a781205783408ac96edd60878f83871 Mon Sep 17 00:00:00 2001 From: Morten Winther Olsson Date: Thu, 5 Apr 2018 02:17:44 +0200 Subject: [PATCH 2/2] Update .bash_profile --- .bash_profile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.bash_profile b/.bash_profile index 1318ea1..eb60b1a 100644 --- a/.bash_profile +++ b/.bash_profile @@ -94,8 +94,11 @@ function ch { if [[ `TASKLIST //FI "STATUS eq running" //FI "IMAGENAME eq devenv.exe" //NH` != "INFO: No tasks are running which match the specified criteria." ]] ; then - echo "Please remember to exit Visual Studio before switching branches." ; - return 2 ; + echo "Visual Studio is running. Are you sure you want to continue [Y/N]?" ; + read confirm ; + if [[ $confirm != y* && $confirm != Y* ]] ; + then return 2 ; + fi ; fi ; git checkout $1