mirror of
https://github.com/mtkennerly/dunamai-action.git
synced 2025-06-20 22:31:08 +00:00
#2: Split command before executing
This commit is contained in:
parent
2c98d04fa2
commit
004550a190
1 changed files with 2 additions and 1 deletions
|
@ -1,10 +1,11 @@
|
||||||
import os
|
import os
|
||||||
|
import shlex
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
|
|
||||||
def run_command(command: str) -> str:
|
def run_command(command: str) -> str:
|
||||||
print("Running command: {}".format(command))
|
print("Running command: {}".format(command))
|
||||||
result = subprocess.run(command, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
result = subprocess.run(shlex.split(command), check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||||
return result.stdout.decode("utf-8").strip()
|
return result.stdout.decode("utf-8").strip()
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue