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

Create the cache folder if it doesn't exist.

parent 14ddc45f
...@@ -149,8 +149,11 @@ of each SUBPROGRAM param.''' ...@@ -149,8 +149,11 @@ of each SUBPROGRAM param.'''
projectCache = os.getenv("PROJECT_CACHE") projectCache = os.getenv("PROJECT_CACHE")
if projectCache is not None: if projectCache is not None:
if not os.path.isdir(projectCache): if not os.path.isdir(projectCache):
panic("The configured cache folder:\n\n\t" + projectCache + try:
"\n\n...is not there!\n") os.mkdir(projectCache)
except:
panic("The configured cache folder:\n\n\t" + projectCache +
"\n\n...is not there!\n")
cachedModelExists = False cachedModelExists = False
aadlASTcache = None aadlASTcache = None
if projectCache is not None: if projectCache is not None:
......
...@@ -230,7 +230,10 @@ def main(): ...@@ -230,7 +230,10 @@ def main():
projectCache = os.getenv("PROJECT_CACHE") projectCache = os.getenv("PROJECT_CACHE")
if projectCache is not None and not os.path.isdir(projectCache): 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 # Backwards compatibility - the '-acn' option is no longer necessary
# (we auto-detect ACN files via their extension) # (we auto-detect ACN files via their extension)
......
...@@ -389,8 +389,11 @@ def ParseAsnFileList(listOfFilenames: List[str]) -> None: # pylint: disable=inv ...@@ -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 # Add basic ASN.1 caching to avoid calling the ASN.1 compiler over and over
projectCache = os.getenv("PROJECT_CACHE") projectCache = os.getenv("PROJECT_CACHE")
if projectCache is not None and not os.path.isdir(projectCache): if projectCache is not None and not os.path.isdir(projectCache):
utility.panic( try:
"The configured cache folder:\n\n\t" + projectCache + "\n\n...is not there!\n") os.mkdir(projectCache)
except:
utility.panic(
"The configured cache folder:\n\n\t" + projectCache + "\n\n...is not there!\n")
xmlAST = xmlAST2 = None xmlAST = xmlAST2 = None
someFilesHaveChanged = False someFilesHaveChanged = False
if projectCache is not None: 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