Run the shell script with the given command and arguments.
(command, *args)
| 77 | |
| 78 | |
| 79 | def 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 | |
| 110 | def _pom_tag(namespace, name): |
no test coverage detected