Set jobid to 1 if design build dir not found
This fixes a bug where SC would crash with a FileNotFoundError if a
build directory isn't found while generating the jobid. If the build
directory doesn't exist yet, the jobid defaults to 1 (the directory gets
created by SC later on).
@@ -1129,6 +1129,7 @@ class Chip:
dirname = self.cfg['dir']['value'][-1]
jobname = self.cfg['jobname']['value'][-1]
+ try:
alljobs = os.listdir(dirname + "/" + design)
if len(self.cfg['jobid']['value']) < 1:
@@ -1139,6 +1140,9 @@ class Chip:
jobid = max(jobid, int(m.group(1)))
jobid = jobid+1
self.set('jobid', str(jobid))
+ except FileNotFoundError:
+ # if no existing build directory, set jobid to 1
+ self.set('jobid', '1')
################################################################################
# Annoying helper class b/c yaml..
