opt: add build wrap in build.py
This commit is contained in:
parent
0319d1b1e5
commit
8f2d21f794
9
build.py
9
build.py
@ -8,6 +8,7 @@ import urllib.request
|
|||||||
import shutil
|
import shutil
|
||||||
import hashlib
|
import hashlib
|
||||||
import argparse
|
import argparse
|
||||||
|
import sys
|
||||||
|
|
||||||
windows = platform.platform().startswith('Windows')
|
windows = platform.platform().startswith('Windows')
|
||||||
osx = platform.platform().startswith(
|
osx = platform.platform().startswith(
|
||||||
@ -17,6 +18,14 @@ exe_path = 'target/release/' + hbb_name
|
|||||||
flutter_win_target_dir = 'flutter/build/windows/runner/Release/'
|
flutter_win_target_dir = 'flutter/build/windows/runner/Release/'
|
||||||
skip_cargo = False
|
skip_cargo = False
|
||||||
|
|
||||||
|
def custom_os_system(cmd):
|
||||||
|
err = os._system(cmd)
|
||||||
|
if err != 0:
|
||||||
|
print(f"Error occured when executing: {cmd}. Exiting.")
|
||||||
|
sys.exit(-1)
|
||||||
|
# replace prebuilt os.system
|
||||||
|
os._system = os.system
|
||||||
|
os.system = custom_os_system
|
||||||
|
|
||||||
def get_version():
|
def get_version():
|
||||||
with open("Cargo.toml", encoding="utf-8") as fh:
|
with open("Cargo.toml", encoding="utf-8") as fh:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user