Skip to content

Commit

Permalink
chore: update package script
Browse files Browse the repository at this point in the history
  • Loading branch information
WEGFan committed Oct 19, 2020
1 parent 99834ca commit 9633965
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions package.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
import re
import subprocess
import sys
import zipfile
from itertools import chain
from pathlib import Path
Expand Down Expand Up @@ -29,10 +30,13 @@
f.write(s)

# build the project
subprocess.run(['dotnet', 'build', '--configuration', 'Release'])
process = subprocess.run(['dotnet', 'build', '--configuration', 'Release'])
if process.returncode != 0:
print('build failed')
sys.exit()

# package
file_list = ['./bin/**/*', './Dialog/**/*', './everest.yaml']
file_list = ['./bin/InfiniteBackups.*', './Dialog/**/*', './everest.yaml']

with zipfile.ZipFile(f'{mod_name}_v{mod_version}.zip', 'w', zipfile.ZIP_DEFLATED) as f:
for file in chain(*[Path('.').glob(i) for i in file_list]):
Expand Down

0 comments on commit 9633965

Please sign in to comment.