Skip to content
This repository has been archived by the owner on Dec 27, 2022. It is now read-only.

Commit

Permalink
加入 powerline 字体,打包时也把字体打包,并生成 zip 压缩包
Browse files Browse the repository at this point in the history
  • Loading branch information
riag committed Mar 16, 2018
1 parent db2a206 commit 9fec1b7
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions package.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ def __init__(self, sys_platform, machine, curr_dir, cargo_bin='cargo'):
self.wsltty_dir = os.path.join(curr_dir, 'wsltty')
self.cargo_bin = os.getenv('CARGO_BIN', 'cargo.exe')
self.config_dir = os.path.join(curr_dir, 'config')
self.ico_dir = os.path.join(curr_dir, 'resources', 'ico')
self.resources_dir = os.path.join(curr_dir, 'resources')
self.ico_dir = os.path.join(self.resources_dir, 'ico')
self.fonts_dir = os.path.join(self.resources_dir, 'fonts')

def copytree(src, dst, symlinks=False, ignore=None):
for item in os.listdir(src):
Expand Down Expand Up @@ -195,8 +197,9 @@ def package(context):

# copy wsltty.exe
wsltty_bin=os.path.join(context.wsltty_dir, 'target', 'release', 'wsltty.exe')
wsltty_dist_name = 'wsltty-%s-%s' % ( wsltty_version, context.platform_machine)
wsltty_dist_dir = os.path.join(context.dist_dir,
'wsltty-%s-%s' % ( wsltty_version, context.platform_machine)
wsltty_dist_name
)

if os.path.exists(wsltty_dist_dir) and os.path.isdir(wsltty_dist_dir):
Expand Down Expand Up @@ -265,6 +268,12 @@ def package(context):
os.path.join(wsltty_dist_dir, 'resources', 'ico')
)

# copy fonts
shutil.copytree(
context.fonts_dir,
os.path.join(wsltty_dist_dir, 'resources', 'fonts')
)

# copy license
shutil.copy(
os.path.join(curr_dir, 'LICENSE.mintty'),
Expand All @@ -277,6 +286,17 @@ def package(context):

generate_version_file(context, wsltty_dist_dir)

# rm file
for m in ['.BUILDINFO','.MTREE', '.PKGINFO']:
p = os.path.join(wsltty_dist_dir, m)
os.remove(p)

# zip dir
call_shell_command([
'zip', '-r', wsltty_dist_name + '.zip',
wsltty_dist_name
], work_dir=context.dist_dir)

if __name__ == '__main__':

context = BuildContext(sys.platform, platform.machine(), curr_dir)
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 9fec1b7

Please sign in to comment.