Skip to content

Commit

Permalink
#212 Make compile and checkout scripts executable
Browse files Browse the repository at this point in the history
- make scripts executable after creating
- moved `chmod` lines earlier in scripts
  • Loading branch information
singhd789 committed Oct 25, 2024
1 parent d1457e2 commit be01922
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion fre/make/gfdlfremake/buildBaremetal.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ def writeScript(self):
self.f.write(self.make+"\n")
self.f.close()

# Make compile script executable
os.chmod(self.bld+"/compile.sh", 0o744)

## TODO run as a batch job on the login cluster
def run(self):
"""
Expand All @@ -118,7 +121,6 @@ def run(self):
- self : The dockerfile object
"""
###### TODO make the Makefile
os.chmod(self.bld+"/compile.sh", 0o744)
command = [self.bld+"/compile.sh","|","tee",self.bld+"/log.compile"]
try:
subprocess.run(args=command, check=True)
Expand Down
4 changes: 3 additions & 1 deletion fre/make/gfdlfremake/checkout.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,16 @@ def finish (self,pc):
else:
self.checkoutScript.close()

# Make checkout script executable
os.chmod(self.src+"/"+self.fname, 0o744)

## TODO: batch script building
def run (self):
"""
Brief: Changes the permission on the checkout script and runs it
Param:
- self The checkout script object
"""
os.chmod(self.src+"/"+self.fname, 0o744)
try:
subprocess.run(args=[self.src+"/"+self.fname], check=True)
except:
Expand Down

0 comments on commit be01922

Please sign in to comment.