mirror of
https://gitlab.com/gabmus/envision.git
synced 2025-08-03 06:38:52 +00:00
Do not create a new Vec in async_process for flatpak env args
This commit is contained in:
parent
1de2050277
commit
2886b20971
1 changed files with 5 additions and 8 deletions
|
@ -18,15 +18,12 @@ pub async fn async_process<S: AsRef<OsStr>, T: AsRef<OsStr>>(
|
||||||
) -> anyhow::Result<AsyncProcessOut> {
|
) -> anyhow::Result<AsyncProcessOut> {
|
||||||
let mut command: Command;
|
let mut command: Command;
|
||||||
if *IS_FLATPAK && host_spawn {
|
if *IS_FLATPAK && host_spawn {
|
||||||
let mut flatpak_env = vec![];
|
|
||||||
for (key, value) in env.unwrap_or_default() {
|
|
||||||
flatpak_env.push(format!("--env={}={}", key, value));
|
|
||||||
}
|
|
||||||
command = Command::new("flatpak-spawn");
|
command = Command::new("flatpak-spawn");
|
||||||
command.arg("--host")
|
command.arg("--host");
|
||||||
.args(flatpak_env)
|
for (key, value) in env.unwrap_or_default() {
|
||||||
.arg(cmd)
|
command.arg(format!("--env={}={}", key, value));
|
||||||
.args(args.unwrap_or_default());
|
}
|
||||||
|
command.arg(cmd).args(args.unwrap_or_default());
|
||||||
} else {
|
} else {
|
||||||
command = Command::new(cmd);
|
command = Command::new(cmd);
|
||||||
command.args(args.unwrap_or_default()).envs(env.unwrap_or_default());
|
command.args(args.unwrap_or_default()).envs(env.unwrap_or_default());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue