This commit is contained in:
parent
f0fb42b6f0
commit
b92c2625c2
3 changed files with 33 additions and 31 deletions
57
Cargo.lock
generated
57
Cargo.lock
generated
|
@ -70,17 +70,6 @@ version = "2.9.0"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd"
|
||||
|
||||
[[package]]
|
||||
name = "bstr"
|
||||
version = "1.11.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "531a9155a481e2ee699d4f98f43c0ca4ff8ee1bfd55c31e9e98fb29d2b176fe0"
|
||||
dependencies = [
|
||||
"memchr",
|
||||
"regex-automata",
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "byteorder"
|
||||
version = "1.5.0"
|
||||
|
@ -166,6 +155,15 @@ dependencies = [
|
|||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "enquote"
|
||||
version = "1.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "06c36cb11dbde389f4096111698d8b567c0720e3452fd5ac3e6b4e47e1939932"
|
||||
dependencies = [
|
||||
"thiserror",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "equivalent"
|
||||
version = "1.0.2"
|
||||
|
@ -196,10 +194,10 @@ version = "0.1.1"
|
|||
dependencies = [
|
||||
"clap",
|
||||
"either",
|
||||
"enquote",
|
||||
"inquire",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"shell-quote",
|
||||
"subprocess",
|
||||
"toml",
|
||||
"yansi",
|
||||
|
@ -355,12 +353,6 @@ dependencies = [
|
|||
"bitflags 2.9.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "regex-automata"
|
||||
version = "0.4.9"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908"
|
||||
|
||||
[[package]]
|
||||
name = "ryu"
|
||||
version = "1.0.20"
|
||||
|
@ -414,15 +406,6 @@ dependencies = [
|
|||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "shell-quote"
|
||||
version = "0.7.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fb502615975ae2365825521fa1529ca7648fd03ce0b0746604e0683856ecd7e4"
|
||||
dependencies = [
|
||||
"bstr",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "signal-hook"
|
||||
version = "0.3.17"
|
||||
|
@ -486,6 +469,26 @@ dependencies = [
|
|||
"unicode-ident",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "thiserror"
|
||||
version = "1.0.69"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52"
|
||||
dependencies = [
|
||||
"thiserror-impl",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "thiserror-impl"
|
||||
version = "1.0.69"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "thread_local"
|
||||
version = "1.1.8"
|
||||
|
|
|
@ -6,10 +6,10 @@ edition = "2024"
|
|||
[dependencies]
|
||||
clap = { version = "4.5.26", features = ["cargo"] }
|
||||
either = { version = "1.15.0", features = ["serde"] }
|
||||
enquote = "1.1.0"
|
||||
inquire = "0.7.5"
|
||||
serde = { version = "1.0.219", features = ["derive"] }
|
||||
serde_json = "1.0.137"
|
||||
shell-quote = "0.7.2"
|
||||
subprocess = "0.2.9"
|
||||
toml = "0.8.20"
|
||||
yansi = "1.0.1"
|
||||
|
|
|
@ -2,7 +2,6 @@ use std::collections::HashMap;
|
|||
|
||||
use either::Either;
|
||||
use serde::Deserialize;
|
||||
use shell_quote::{Bash, QuoteRefExt};
|
||||
use subprocess::Exec;
|
||||
|
||||
use crate::git::switch_branch;
|
||||
|
@ -138,11 +137,11 @@ pub fn build_script_vars(expose: Option<Vec<String>>, vars: &[AskValue]) -> Stri
|
|||
.iter()
|
||||
.map(|x| match x {
|
||||
AskValue::Text(name, text) => {
|
||||
format!("export {name}='{}'", || -> String { text.quoted(Bash) }())
|
||||
format!("export {name}='{}'", enquote::enquote('\'', text))
|
||||
}
|
||||
AskValue::Number(name, num) => format!("export {name}={num}"),
|
||||
AskValue::Selection(name, select) => {
|
||||
format!("export {name}='{}'", || -> String { select.quoted(Bash) }())
|
||||
format!("export {name}='{}'", enquote::enquote('\'', select))
|
||||
}
|
||||
AskValue::Bool(name, b) => format!("export {name}='{}'", b.to_string()),
|
||||
})
|
||||
|
|
Loading…
Add table
Reference in a new issue