Skip to content

Commit 6b4b279

Browse files
NejcSzanjonke
authored andcommitted
raise error if using shell scripts on windows
1 parent bf32b2e commit 6b4b279

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

render_machine/render_utils.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,9 @@ def execute_script( # noqa: C901
101101
script_timeout = timeout if timeout is not None else SCRIPT_EXECUTION_TIMEOUT
102102

103103
script_path = file_utils.add_current_path_if_no_path(script)
104-
# On Windows, .ps1 files must be run via PowerShell, not as the executable
105-
if sys.platform == "win32" and script_path.lower().endswith(".ps1"):
104+
if sys.platform == "win32":
105+
if not script_path.lower().endswith(".ps1"):
106+
raise ValueError(f"On Windows, only PowerShell (.ps1) scripts are supported, but got: {script_path}")
106107
cmd = ["powershell.exe", "-NoProfile", "-ExecutionPolicy", "Bypass", "-File", script_path] + scripts_args
107108
else:
108109
cmd = [script_path] + scripts_args

0 commit comments

Comments
 (0)