Skip to content
This repository has been archived by the owner on May 8, 2023. It is now read-only.

Commit

Permalink
Remove resources from build script
Browse files Browse the repository at this point in the history
  • Loading branch information
lgfrbcsgo committed Jun 2, 2020
1 parent ef106f4 commit a75f89d
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@
"mod_async_server",
]

RESOURCES = [
("LICENSE", "."),
("README.md", "."),
]

RELEASE_DEPENDENCIES = [
"https://github.com/lgfrbcsgo/wot-async/releases/download/v0.1.3/lgfrbcsgo.async_0.1.3.wotmod",
]
Expand All @@ -35,8 +30,9 @@ def wotmod():
# clean dist directory
subprocess.check_call(["rm", "-rf", "dist/wotmod"])

# make source directory
source_dst = "dist/wotmod/unpacked/res/scripts/client"

# make source directory
subprocess.check_call(["mkdir", "-p", source_dst])

# copy sources
Expand All @@ -46,15 +42,14 @@ def wotmod():
# compile sources
subprocess.check_call(["python2.7", "-m", "compileall", source_dst])

# copy resources
unpacked_dst = "dist/wotmod/unpacked"
for src, dst in RESOURCES:
dst = path.join(unpacked_dst, dst)
subprocess.check_call(["mkdir", "-p", path.dirname(dst)])
subprocess.check_call(["cp", "-r", src, dst])

# copy license and readme
subprocess.check_call(["cp", "-r", "LICENSE", unpacked_dst])
subprocess.check_call(["cp", "-r", "README.md", unpacked_dst])

# create meta.xml content
meta_xml = """
metadata = """
<root>
<id>{id}</id>
<version>{version}</version>
Expand All @@ -67,7 +62,7 @@ def wotmod():

# write meta.xml
with open("dist/wotmod/unpacked/meta.xml", "w") as meta_file:
meta_file.write(meta_xml.strip())
meta_file.write(metadata.strip())

# create wotmod file
wotmod_dst = path.join("dist/wotmod", get_wotmod_name())
Expand Down

0 comments on commit a75f89d

Please sign in to comment.