diff options
| author | Sefa Eyeoglu <contact@scrumplex.net> | 2022-03-21 21:34:52 +0100 |
|---|---|---|
| committer | Sefa Eyeoglu <contact@scrumplex.net> | 2022-04-05 14:30:30 +0200 |
| commit | a8babf42c5176fc7c86d60caa2fc56c0abbf2e04 (patch) | |
| tree | fc698f7d4d8c91406ad52440ebedfa2366b0c0da /meta/common.py | |
| parent | 0731956adc560616fcbe8ea24d6dc3a49e3ad0c6 (diff) | |
| download | Project-Tick-a8babf42c5176fc7c86d60caa2fc56c0abbf2e04.tar.gz Project-Tick-a8babf42c5176fc7c86d60caa2fc56c0abbf2e04.zip | |
refactor: move utils into package
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) |
