Commit 88a80ee7 authored by Thanassis Tsiodras's avatar Thanassis Tsiodras

Create the cache folder if it doesn't exist.

parent 14ddc45f
......@@ -149,8 +149,11 @@ of each SUBPROGRAM param.'''
projectCache = os.getenv("PROJECT_CACHE")
if projectCache is not None:
if not os.path.isdir(projectCache):
panic("The configured cache folder:\n\n\t" + projectCache +
"\n\n...is not there!\n")
try:
os.mkdir(projectCache)
except:
panic("The configured cache folder:\n\n\t" + projectCache +
"\n\n...is not there!\n")
cachedModelExists = False
aadlASTcache = None
if projectCache is not None:
......
......@@ -230,7 +230,10 @@ def main():
projectCache = os.getenv("PROJECT_CACHE")
if projectCache is not None and not os.path.isdir(projectCache):
panic("The configured cache folder:\n\n\t" + projectCache + "\n\n...is not there!\n")
try:
os.mkdir(projectCache)
except:
panic("The configured cache folder:\n\n\t" + projectCache + "\n\n...is not there!\n")
# Backwards compatibility - the '-acn' option is no longer necessary
# (we auto-detect ACN files via their extension)
......
......@@ -389,8 +389,11 @@ def ParseAsnFileList(listOfFilenames: List[str]) -> None: # pylint: disable=inv
# Add basic ASN.1 caching to avoid calling the ASN.1 compiler over and over
projectCache = os.getenv("PROJECT_CACHE")
if projectCache is not None and not os.path.isdir(projectCache):
utility.panic(
"The configured cache folder:\n\n\t" + projectCache + "\n\n...is not there!\n")
try:
os.mkdir(projectCache)
except:
utility.panic(
"The configured cache folder:\n\n\t" + projectCache + "\n\n...is not there!\n")
xmlAST = xmlAST2 = None
someFilesHaveChanged = False
if projectCache is not None:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment