MCPcopy Create free account
hub / github.com/apache/fory / run_shell_script

Function run_shell_script

ci/run_ci.py:79–107  ·  view source on GitHub ↗

Run the shell script with the given command and arguments.

(command, *args)

Source from the content-addressed store, hash-verified

77
78
79def run_shell_script(command, *args):
80 """Run the shell script with the given command and arguments."""
81 script_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "run_ci.sh")
82
83 if is_windows():
84 # On Windows, try to use bash if available
85 bash_path = shutil.which("bash")
86 if bash_path:
87 cmd = [bash_path, script_path, command]
88 cmd.extend(args)
89 logging.info(f"Falling back to shell script with bash: {' '.join(cmd)}")
90 sys.exit(subprocess.call(cmd))
91 else:
92 logging.error(
93 "Bash is not available on this Windows system. Cannot run shell script."
94 )
95 logging.error(
96 "Please install Git Bash, WSL, or Cygwin to run shell scripts on Windows."
97 )
98 logging.error(
99 "Alternatively, set USE_PYTHON_JAVA=1 to use the Python implementation."
100 )
101 sys.exit(1)
102 else:
103 # On Unix-like systems, run the script directly
104 cmd = [script_path, command]
105 cmd.extend(args)
106 logging.info(f"Falling back to shell script: {' '.join(cmd)}")
107 sys.exit(subprocess.call(cmd))
108
109
110def _pom_tag(namespace, name):

Callers 1

parse_argsFunction · 0.85

Calls 4

is_windowsFunction · 0.90
extendMethod · 0.80
infoMethod · 0.65
errorMethod · 0.65

Tested by

no test coverage detected