Move get_platform_cmd_prefix into util.py (#4495)
get_platform_cmd_prefix implement multiple times in multiple function. Also add function get_python_cmd_prefix, call to python script always add python command so that on windows, the python script doesn't have executable permission also can be called. JerryScript-DCO-1.0-Signed-off-by: Yonggang Luo luoyonggang@gmail.com
This commit is contained in:
@@ -65,3 +65,14 @@ def print_test_result(tested, total, is_passed, passed_string, test_path, is_sna
|
||||
|
||||
color = TERM_GREEN if is_passed else TERM_RED
|
||||
print("[%4d/%4d] %s%s: %s%s%s" % (tested, total, color, passed_string, test_path, snapshot_string, TERM_NORMAL))
|
||||
|
||||
|
||||
def get_platform_cmd_prefix():
|
||||
if sys.platform == 'win32':
|
||||
return ['cmd', '/S', '/C']
|
||||
return []
|
||||
|
||||
|
||||
def get_python_cmd_prefix():
|
||||
# python script doesn't have execute permission on github actions windows runner
|
||||
return get_platform_cmd_prefix() + [sys.executable or 'python']
|
||||
|
||||
Reference in New Issue
Block a user