Skip to content

Commit

Permalink
store urls in binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
Pixelsuft committed Sep 30, 2023
1 parent 553b435 commit 0f9c7d1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
7 changes: 7 additions & 0 deletions template.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"binaries-url": "https://github.com/gdlocalisation/gdl-binaries/releases/latest/download/gdl-binaries.bin.gzip",
"settings-url": "https://www.gdlocalisation.uk/",
"site-url": "https://www.gdlocalisation.uk/",
"github-url": "https://github.com/gdlocalisation/",
"discord-url": "https://discord.gg/CScsGU3N6M"
}
16 changes: 11 additions & 5 deletions win/make_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,14 @@ def __init__(self) -> None:
self.assets_dir = self.parent_cwd.joinpath('gdl-assets')
if not self.assets_dir.is_dir():
raise FileNotFoundError(
f'Could not find gdl-assets at {self.assets_dir}')
f'Could not find gdl-assets at {self.assets_dir}'
)
if self.out_dir.is_dir():
shutil.rmtree(self.out_dir)
self.out_dir.mkdir()
self.ball_json = {}
self.ball_json = json.loads(open(
self.parent_cwd.joinpath('template.json'), 'r', encoding='utf-8'
).read())
self.ball = b''
self.append_gdl_assets()
self.append_gdl_binaries()
Expand Down Expand Up @@ -72,11 +75,14 @@ def write_out(self) -> None:

def print_stats(self, compressed: bytes) -> None:
print(
f'Uncompressed size: {round(len(self.ball) / 1024 / 1024 * 100) / 100}MB')
f'Uncompressed size: {round(len(self.ball) / 1024 / 1024 * 100) / 100}MB'
)
print(
f'Compressed size: {round(len(compressed) / 1024 / 1024 * 100) / 100}MB')
f'Compressed size: {round(len(compressed) / 1024 / 1024 * 100) / 100}MB'
)
print(
f'[{round(len(compressed) / len(self.ball) * 100)}% of 100%] or', end=' ')
f'[{round(len(compressed) / len(self.ball) * 100)}% of 100%] or', end=' '
)
print(f'[100% of {round(len(self.ball) / len(compressed) * 100)}%]')


Expand Down

0 comments on commit 0f9c7d1

Please sign in to comment.