fix(server): run on non-Windows python (#94)
This commit is contained in:
@@ -88,8 +88,19 @@ def execute_command():
|
|||||||
|
|
||||||
# Execute the command without any safety checks.
|
# Execute the command without any safety checks.
|
||||||
try:
|
try:
|
||||||
result = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=shell, text=True,
|
if platform_name == "Windows":
|
||||||
timeout=120, creationflags=subprocess.CREATE_NO_WINDOW)
|
flags = subprocess.CREATE_NO_WINDOW
|
||||||
|
else:
|
||||||
|
flags = 0
|
||||||
|
result = subprocess.run(
|
||||||
|
command,
|
||||||
|
stdout=subprocess.PIPE,
|
||||||
|
stderr=subprocess.PIPE,
|
||||||
|
shell=shell,
|
||||||
|
text=True,
|
||||||
|
timeout=120,
|
||||||
|
creationflags=flags,
|
||||||
|
)
|
||||||
return jsonify({
|
return jsonify({
|
||||||
'status': 'success',
|
'status': 'success',
|
||||||
'output': result.stdout,
|
'output': result.stdout,
|
||||||
|
|||||||
Reference in New Issue
Block a user