Skip to content

Commit

Permalink
Merge pull request #220 from NOAA-GFDL/212.make-scripts-executable
Browse files Browse the repository at this point in the history
 #212 Make compile and checkout scripts executable
  • Loading branch information
ilaflott authored Oct 28, 2024
2 parents d1457e2 + be01922 commit 65fc0c2
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 65fc0c2

Please sign in to comment.