diff options
Diffstat (limited to 'meta')
| -rw-r--r-- | meta/common/__init__.py (renamed from meta/common.py) | 12 | ||||
| -rw-r--r-- | meta/common/fabric.py | 10 | ||||
| -rw-r--r-- | meta/metautil.py | 3 |
3 files changed, 24 insertions, 1 deletions
diff --git a/meta/common.py b/meta/common/__init__.py index 5454f517f3..77aa996552 100644 --- a/meta/common.py +++ b/meta/common/__init__.py @@ -1,5 +1,7 @@ import os +DATETIME_FORMAT_HTTP = "%a, %d %b %Y %H:%M:%S %Z" + def polymc_path(): if "PMC_DIR" in os.environ: @@ -13,7 +15,17 @@ def upstream_path(): return "upstream" +def ensure_upstream_dir(path): + path = os.path.join(upstream_path(), path) + if not os.path.exists(path): + os.makedirs(path) + + def ensure_component_dir(component_id): path = os.path.join(polymc_path(), component_id) if not os.path.exists(path): os.makedirs(path) + + +def transform_maven_key(maven_key: str): + return maven_key.replace(":", ".") diff --git a/meta/common/fabric.py b/meta/common/fabric.py new file mode 100644 index 0000000000..0861730ce9 --- /dev/null +++ b/meta/common/fabric.py @@ -0,0 +1,10 @@ +from os.path import join + +BASE_DIR = "fabric" + +JARS_DIR = join(BASE_DIR, "jars") +INSTALLER_INFO_DIR = join(BASE_DIR, "loader-installer-json") +META_DIR = join(BASE_DIR, "loader-installer-json") + +LOADER_COMPONENT = "net.fabricmc.fabric-loader" +INTERMEDIARY_COMPONENT = "net.fabricmc.intermediary" diff --git a/meta/metautil.py b/meta/metautil.py index e417bd6e65..11c4009868 100644 --- a/meta/metautil.py +++ b/meta/metautil.py @@ -4,8 +4,9 @@ import os import iso8601 from .jsonobject import * +from .common import polymc_path -PMC_DIR = os.environ["PMC_DIR"] +PMC_DIR = polymc_path() class ISOTimestampProperty(AbstractDateProperty): |
