Merge pull request #272 from alexanderkjeldaas/ak/run-shell

fix: /run (cd ..; ls) should work
This commit is contained in:
paul-gauthier 2023-10-18 12:35:17 -07:00 committed by GitHub
commit 44aa5c6d63
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -388,9 +388,8 @@ class Commands:
"Run a shell command and optionally add the output to the chat" "Run a shell command and optionally add the output to the chat"
combined_output = None combined_output = None
try: try:
parsed_args = shlex.split(args)
result = subprocess.run( result = subprocess.run(
parsed_args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True, shell=True
) )
combined_output = result.stdout combined_output = result.stdout
except Exception as e: except Exception as e: