提交 d4e2424d 编写于 作者: P pilipala195 提交者: Gitee

Add path validity check #I3D2CD

上级 9fa8be84
......@@ -128,7 +128,10 @@ class Config(metaclass=Singleton):
@property
def build_path(self):
return os.path.join(self.root_path, 'build', 'lite')
_build_path = os.path.join(self.root_path, 'build', 'lite')
if not os.path.isdir(_build_path):
raise Exception(f'Invalid build path: {_build_path}')
return _build_path
@property
def out_path(self):
......@@ -144,7 +147,10 @@ class Config(metaclass=Singleton):
@property
def vendor_path(self):
return os.path.join(self.root_path, 'vendor')
_vendor_path = os.path.join(self.root_path, 'vendor')
if not os.path.isdir(_vendor_path):
raise Exception(f'Invalid vendor path: {_vendor_path}')
return _vendor_path
@property
def build_tools_path(self):
......
......@@ -169,21 +169,21 @@ def args_factory(args_dict):
def hb_info(msg):
level = 'info'
for line in msg.splitlines():
for line in str(msg).splitlines():
sys.stdout.write(message(level, line))
sys.stdout.flush()
def hb_warning(msg):
level = 'warning'
for line in msg.splitlines():
for line in str(msg).splitlines():
sys.stderr.write(message(level, line))
sys.stderr.flush()
def hb_error(msg):
level = 'error'
for line in msg.splitlines():
for line in str(msg).splitlines():
sys.stderr.write(message(level, line))
sys.stderr.flush()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册