Add missing directories
This commit is contained in:
parent
0f273674c5
commit
f980220489
4
build.py
4
build.py
@ -117,7 +117,7 @@ def calculate_hash(filename: Path):
|
|||||||
|
|
||||||
def download_file(file: DownloadInfo, filename: Path):
|
def download_file(file: DownloadInfo, filename: Path):
|
||||||
if not filename.exists():
|
if not filename.exists():
|
||||||
filename.parent.mkdir(exist_ok=True)
|
filename.parent.mkdir(exist_ok=True, parents=True)
|
||||||
print(f"Downloading new file {file['url']}")
|
print(f"Downloading new file {file['url']}")
|
||||||
urllib.request.urlretrieve(file["url"], filename)
|
urllib.request.urlretrieve(file["url"], filename)
|
||||||
sha1 = calculate_hash(filename)
|
sha1 = calculate_hash(filename)
|
||||||
@ -158,7 +158,7 @@ def build_version(manifest: VersionManifest, version_id: str, repository: str =
|
|||||||
java_version = version['javaVersion']
|
java_version = version['javaVersion']
|
||||||
print(
|
print(
|
||||||
f"Version [{version['type']}] {version['id']} requires java version {java_version['majorVersion']} ({java_version['component']})")
|
f"Version [{version['type']}] {version['id']} requires java version {java_version['majorVersion']} ({java_version['component']})")
|
||||||
server_jar_file = Path(f"versions/{version['id']}/server.jar")
|
server_jar_file = Path("versions") / version['id'] / "server.jar"
|
||||||
server_jar = version["downloads"]["server"]
|
server_jar = version["downloads"]["server"]
|
||||||
download_file(server_jar, server_jar_file)
|
download_file(server_jar, server_jar_file)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user