Doing final pass of adjustments with anythingllm
This commit is contained in:
@@ -10,7 +10,8 @@ def run_powershell(script: str, base_dir: str) -> str:
|
||||
Returns a string combining stdout, stderr, and exit code.
|
||||
Raises nothing - all errors are captured into the return string.
|
||||
"""
|
||||
full_script = f"Set-Location -LiteralPath '{base_dir}'\n{script}"
|
||||
safe_dir = str(base_dir).replace("'", "''")
|
||||
full_script = f"Set-Location -LiteralPath '{safe_dir}'\n{script}"
|
||||
# Try common executable names
|
||||
exe = next((x for x in ["powershell.exe", "pwsh.exe", "powershell", "pwsh"] if shutil.which(x)), None)
|
||||
if not exe: return "ERROR: Neither powershell nor pwsh found in PATH"
|
||||
|
||||
Reference in New Issue
Block a user