diff options
Diffstat (limited to 'meta/common.py')
| -rw-r--r-- | meta/common.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/meta/common.py b/meta/common.py new file mode 100644 index 0000000000..5454f517f3 --- /dev/null +++ b/meta/common.py @@ -0,0 +1,19 @@ +import os + + +def polymc_path(): + if "PMC_DIR" in os.environ: + return os.environ["PMC_DIR"] + return "polymc" + + +def upstream_path(): + if "UPSTREAM_DIR" in os.environ: + return os.environ["UPSTREAM_DIR"] + return "upstream" + + +def ensure_component_dir(component_id): + path = os.path.join(polymc_path(), component_id) + if not os.path.exists(path): + os.makedirs(path) |
