Skip to content

Commit

Permalink
cd -> cd /d
Browse files Browse the repository at this point in the history
  • Loading branch information
FreddieAkeroyd committed Aug 29, 2024
1 parent b2e5c2f commit 3974c6a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions installation_and_upgrade/ibex_install_utils/tasks/git_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -32,30 +32,30 @@ 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")
except subprocess.CalledProcessError as e:
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:
Expand All @@ -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}")

0 comments on commit 3974c6a

Please sign in to comment.