Expand user directory on server /launch and /execute'
This commit is contained in:
@@ -45,6 +45,11 @@ def execute_command():
|
||||
if isinstance(command, str) and not shell:
|
||||
command = shlex.split(command)
|
||||
|
||||
# Expand user directory
|
||||
for i, arg in enumerate(command):
|
||||
if arg.startswith("~/"):
|
||||
command[i] = os.path.expanduser(arg)
|
||||
|
||||
# Execute the command without any safety checks.
|
||||
try:
|
||||
result = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=shell, text=True)
|
||||
@@ -82,6 +87,11 @@ def launch_app():
|
||||
if isinstance(command, str) and not shell:
|
||||
command = shlex.split(command)
|
||||
|
||||
# Expand user directory
|
||||
for i, arg in enumerate(command):
|
||||
if arg.startswith("~/"):
|
||||
command[i] = os.path.expanduser(arg)
|
||||
|
||||
try:
|
||||
if 'google-chrome' in command and _get_machine_architecture() == 'arm':
|
||||
index = command.index('google-chrome')
|
||||
|
||||
Reference in New Issue
Block a user