From be0192248f33afaf501a2b11980314d8fec1e058 Mon Sep 17 00:00:00 2001 From: Dana Singh Date: Fri, 25 Oct 2024 15:41:19 -0400 Subject: [PATCH] #212 Make compile and checkout scripts executable - make scripts executable after creating - moved `chmod` lines earlier in scripts --- fre/make/gfdlfremake/buildBaremetal.py | 4 +++- fre/make/gfdlfremake/checkout.py | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/fre/make/gfdlfremake/buildBaremetal.py b/fre/make/gfdlfremake/buildBaremetal.py index f0279a11..fdb4e2d8 100644 --- a/fre/make/gfdlfremake/buildBaremetal.py +++ b/fre/make/gfdlfremake/buildBaremetal.py @@ -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): """ @@ -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) diff --git a/fre/make/gfdlfremake/checkout.py b/fre/make/gfdlfremake/checkout.py index 3a1ffa9b..4e4c905c 100644 --- a/fre/make/gfdlfremake/checkout.py +++ b/fre/make/gfdlfremake/checkout.py @@ -108,6 +108,9 @@ 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): """ @@ -115,7 +118,6 @@ def run (self): Param: - self The checkout script object """ - os.chmod(self.src+"/"+self.fname, 0o744) try: subprocess.run(args=[self.src+"/"+self.fname], check=True) except: