mirror of
https://codeberg.org/icewind/haze.git
synced 2026-06-03 09:04:12 +02:00
handle quotes in post-setup commands
This commit is contained in:
parent
5e020204e3
commit
9cca74924d
3 changed files with 14 additions and 2 deletions
7
Cargo.lock
generated
7
Cargo.lock
generated
|
|
@ -445,6 +445,7 @@ dependencies = [
|
|||
"petname",
|
||||
"reqwest",
|
||||
"serde",
|
||||
"shell-words",
|
||||
"tar",
|
||||
"termion",
|
||||
"tokio",
|
||||
|
|
@ -1128,6 +1129,12 @@ dependencies = [
|
|||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "shell-words"
|
||||
version = "1.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde"
|
||||
|
||||
[[package]]
|
||||
name = "slab"
|
||||
version = "0.4.5"
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ flate2 = "1"
|
|||
async-trait = "0.1"
|
||||
enum_dispatch = "0.3"
|
||||
miette = { version = "3", features = ["fancy"] }
|
||||
shell-words = "1.0.0"
|
||||
|
||||
[profile.release]
|
||||
lto = true
|
||||
|
|
|
|||
|
|
@ -356,11 +356,15 @@ async fn setup(docker: &mut Docker, options: CloudOptions, config: &HazeConfig)
|
|||
}
|
||||
for service in &cloud.services {
|
||||
for cmd in service.post_setup(&docker, &cloud.id).await? {
|
||||
cloud.exec(docker, cmd.split(" ").collect(), false).await?;
|
||||
cloud
|
||||
.exec(docker, shell_words::split(&cmd).into_diagnostic()?, false)
|
||||
.await?;
|
||||
}
|
||||
}
|
||||
for cmd in &config.auto_setup.post_setup {
|
||||
cloud.exec(docker, cmd.split(" ").collect(), false).await?;
|
||||
cloud
|
||||
.exec(docker, shell_words::split(&cmd).into_diagnostic()?, false)
|
||||
.await?;
|
||||
}
|
||||
}
|
||||
Ok(cloud)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue