Simplify flatpak-spawn args
This commit is contained in:
parent
a41a38bcc9
commit
967f039e60
|
@ -407,20 +407,13 @@ def update_config_to_cell_height(filename):
|
||||||
|
|
||||||
def get_flatpak_args(args, envv, cwd):
|
def get_flatpak_args(args, envv, cwd):
|
||||||
"""Contruct args to be executed via flatpak-spawn"""
|
"""Contruct args to be executed via flatpak-spawn"""
|
||||||
import json
|
|
||||||
flatpak_args = None
|
flatpak_args = None
|
||||||
shell = [args[0]]
|
|
||||||
env_args = ['--env={}'.format(env) for env in envv]
|
env_args = ['--env={}'.format(env) for env in envv]
|
||||||
flatpak_spawn = [
|
flatpak_spawn = [
|
||||||
"flatpak-spawn", "--host", "--watch-bus", "--forward-fd=1",
|
"flatpak-spawn", "--host", "--watch-bus", "--forward-fd=1",
|
||||||
"--forward-fd=2", "--directory={}".format(cwd)
|
"--forward-fd=2", "--directory={}".format(cwd)
|
||||||
]
|
]
|
||||||
if len(args) == 2:
|
flatpak_args = flatpak_spawn + env_args + args
|
||||||
flatpak_args = flatpak_spawn + env_args + shell
|
|
||||||
|
|
||||||
# Support -x, -e, custom commands etc.
|
|
||||||
if len(args) > 2:
|
|
||||||
flatpak_args = flatpak_spawn + env_args + args[1:]
|
|
||||||
|
|
||||||
dbg('returned flatpak args: %s' % flatpak_args)
|
dbg('returned flatpak args: %s' % flatpak_args)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue