Skip to content

Commit a7641d8

Browse files
author
Shun Lin
committed
Merge pull request #326 from hugohuang1111/fix_run_cocos_package_fail
rase exception when run cocos package fail
2 parents 1ad9331 + 4cca60e commit a7641d8

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

plugins/plugin_package/plugin_package.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,14 @@ def parse_args(self, argv):
3131

3232
def run(self, argv, dependencies):
3333
cmd = self._get_sdkbox_path() + ' --runincocos ' + ' '.join(argv)
34-
self._run_cmd(cmd)
34+
ret = self._run_cmd(cmd)
35+
if 0 != ret:
36+
message = MultiLanguage.get_string('COCOS_ERROR_RUNNING_CMD_RET_FMT', str(ret))
37+
raise cocos.CCPluginError(message, cocos.CCPluginError.ERROR_RUNNING_CMD)
3538

3639
def _run_cmd(self, command, cwd=None):
3740
# cocos.CMDRunner.run_cmd(command, False, cwd=cwd)
38-
subprocess.call(command, shell=True, cwd=cwd)
41+
return subprocess.call(command, shell=True, cwd=cwd)
3942

4043
def _get_sdkbox_path(self):
4144
path = ''

plugins/plugin_package/sdkbox.pyc

1.66 KB
Binary file not shown.

0 commit comments

Comments
 (0)