From 3974c6a52835772082ecef8fec25a78dd57d1e12 Mon Sep 17 00:00:00 2001 From: Freddie Akeroyd Date: Thu, 29 Aug 2024 16:59:51 +0100 Subject: [PATCH] cd -> cd /d --- .../ibex_install_utils/tasks/git_tasks.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/installation_and_upgrade/ibex_install_utils/tasks/git_tasks.py b/installation_and_upgrade/ibex_install_utils/tasks/git_tasks.py index 37a77fd..f40f389 100644 --- a/installation_and_upgrade/ibex_install_utils/tasks/git_tasks.py +++ b/installation_and_upgrade/ibex_install_utils/tasks/git_tasks.py @@ -9,7 +9,7 @@ class GitTasks(BaseTasks): @task(f"Show Git status in {EPICS_PATH}") def show_git_status(self): - subprocess.call(f"cd {EPICS_PATH} && git status", shell=True) + subprocess.call(f"cd /d {EPICS_PATH} && git status", shell=True) @task("Swap instrument git branch to release on CONTROL-SVCS") def checkout_to_release_branch(self): @@ -32,7 +32,7 @@ def checkout_to_release_branch(self): try: # assumes the alias 'origin' does not exist yet subprocess.check_call( - f"cd {EPICS_PATH} && git remote add origin http://control-svcs.isis.cclrc.ac.uk/gitroot/releases/{version}/{remote_repo}", + f"cd /d {EPICS_PATH} && git remote add origin http://control-svcs.isis.cclrc.ac.uk/gitroot/releases/{version}/{remote_repo}", shell=True, ) print("Added the remote") @@ -40,22 +40,22 @@ def checkout_to_release_branch(self): print(f"Error creating remote: {e}") try: - subprocess.check_call(f"cd {EPICS_PATH} && git fetch", shell=True) + subprocess.check_call(f"cd /d {EPICS_PATH} && git fetch", shell=True) print("Fetched remote") except subprocess.CalledProcessError as e: print(f"Error fetching remote: {e}") try: # run a git status to rebuild index if needed - subprocess.check_call(f"cd {EPICS_PATH} && git status", shell=True) + subprocess.check_call(f"cd /d {EPICS_PATH} && git status", shell=True) except subprocess.CalledProcessError as e: print(f"Error running git status: {e}") try: - subprocess.check_call(f"cd {EPICS_PATH} && git checkout -b %COMPUTERNAME%", shell=True) + subprocess.check_call(f"cd /d {EPICS_PATH} && git checkout -b %COMPUTERNAME%", shell=True) print("Checked out to the new release branch") subprocess.check_call( - f"cd {EPICS_PATH} && git push -u origin %COMPUTERNAME%", shell=True + f"cd /d {EPICS_PATH} && git push -u origin %COMPUTERNAME%", shell=True ) print("Pushed to the remote") except subprocess.CalledProcessError as e: @@ -65,7 +65,7 @@ def checkout_to_release_branch(self): # something for the future in case creting new beranch fails - maybe one exists we want to use? # try: -# subprocess.check_call(f"cd {EPICS_PATH} && git checkout %COMPUTERNAME%", shell=True) +# subprocess.check_call(f"cd /d {EPICS_PATH} && git checkout %COMPUTERNAME%", shell=True) # print("Switched to existing release branch") # except subprocess.CalledProcessError as e: # print(f"Error switching to existing release branch and push: {e}")