99class GitTasks (BaseTasks ):
1010 @task (f"Show Git status in { EPICS_PATH } " )
1111 def show_git_status (self ):
12- subprocess .call (f"cd { EPICS_PATH } && git status" , shell = True )
12+ subprocess .call (f"cd /d { EPICS_PATH } && git status" , shell = True )
1313
1414 @task ("Swap instrument git branch to release on CONTROL-SVCS" )
1515 def checkout_to_release_branch (self ):
@@ -32,30 +32,30 @@ def checkout_to_release_branch(self):
3232 try :
3333 # assumes the alias 'origin' does not exist yet
3434 subprocess .check_call (
35- f"cd { EPICS_PATH } && git remote add origin http://control-svcs.isis.cclrc.ac.uk/gitroot/releases/{ version } /{ remote_repo } " ,
35+ f"cd /d { EPICS_PATH } && git remote add origin http://control-svcs.isis.cclrc.ac.uk/gitroot/releases/{ version } /{ remote_repo } " ,
3636 shell = True ,
3737 )
3838 print ("Added the remote" )
3939 except subprocess .CalledProcessError as e :
4040 print (f"Error creating remote: { e } " )
4141
4242 try :
43- subprocess .check_call (f"cd { EPICS_PATH } && git fetch" , shell = True )
43+ subprocess .check_call (f"cd /d { EPICS_PATH } && git fetch" , shell = True )
4444 print ("Fetched remote" )
4545 except subprocess .CalledProcessError as e :
4646 print (f"Error fetching remote: { e } " )
4747
4848 try :
4949 # run a git status to rebuild index if needed
50- subprocess .check_call (f"cd { EPICS_PATH } && git status" , shell = True )
50+ subprocess .check_call (f"cd /d { EPICS_PATH } && git status" , shell = True )
5151 except subprocess .CalledProcessError as e :
5252 print (f"Error running git status: { e } " )
5353
5454 try :
55- subprocess .check_call (f"cd { EPICS_PATH } && git checkout -b %COMPUTERNAME%" , shell = True )
55+ subprocess .check_call (f"cd /d { EPICS_PATH } && git checkout -b %COMPUTERNAME%" , shell = True )
5656 print ("Checked out to the new release branch" )
5757 subprocess .check_call (
58- f"cd { EPICS_PATH } && git push -u origin %COMPUTERNAME%" , shell = True
58+ f"cd /d { EPICS_PATH } && git push -u origin %COMPUTERNAME%" , shell = True
5959 )
6060 print ("Pushed to the remote" )
6161 except subprocess .CalledProcessError as e :
@@ -65,7 +65,7 @@ def checkout_to_release_branch(self):
6565
6666# something for the future in case creting new beranch fails - maybe one exists we want to use?
6767# try:
68- # subprocess.check_call(f"cd {EPICS_PATH} && git checkout %COMPUTERNAME%", shell=True)
68+ # subprocess.check_call(f"cd /d {EPICS_PATH} && git checkout %COMPUTERNAME%", shell=True)
6969# print("Switched to existing release branch")
7070# except subprocess.CalledProcessError as e:
7171# print(f"Error switching to existing release branch and push: {e}")
0 commit comments