From 9f8780c2f36d6ba81f9da1569e9121f3e537bf34 Mon Sep 17 00:00:00 2001 From: Dmitriy <43755002+psydvl@users.noreply.github.com> Date: Tue, 13 Dec 2022 00:19:03 +0300 Subject: [PATCH] frontend: cli: run_porgram: Quote passed args Will allow pass symbols like & --- bottles/frontend/cli/cli.in | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/bottles/frontend/cli/cli.in b/bottles/frontend/cli/cli.in index 2116443ae8..e25b2c7256 100755 --- a/bottles/frontend/cli/cli.in +++ b/bottles/frontend/cli/cli.in @@ -24,6 +24,7 @@ import sys import uuid import json import signal +import shlex import argparse import warnings @@ -538,7 +539,7 @@ class CLI: _bottle = self.args.bottle _program = self.args.program _keep = self.args.keep_args - _args = " ".join(self.args.args) + _args = self.args.args _executable = self.args.executable _cwd = None _script = None @@ -570,7 +571,9 @@ class CLI: program = [p for p in programs if p["name"] == _program][0] _executable = program.get("path", "") if _keep: - _args = program.get("arguments", "") + " " + _args + default_args = program.get("arguments", "") + if "".__ne__(default_args): + _args.insert(0, default_args) _cwd = program.get("folder", "") _script = program.get("script", None) @@ -587,10 +590,12 @@ class CLI: if program.get("virtual_desktop") != _virt_desktop: _virt_desktop = program.get("virtual_desktop") + _args_string = shlex.join(_args) + WineExecutor( bottle, exec_path=_executable, - args=_args, + args=_args_string, cwd=_cwd, post_script=_script, override_dxvk=_dxvk,