Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions app/src/env_vars/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ impl EnvVarCollection {
self.vars.iter().map(|var| (var.name.as_str(), &var.value))
}

pub fn export_variables(&self, delimeter: &str, shell_family: ShellFamily) -> String {
serialize_variables_internal(self.key_value_iter(), "", "=", "", delimeter, shell_family)
pub fn export_variables(&self, delimiter: &str, shell_family: ShellFamily) -> String {
serialize_variables_internal(self.key_value_iter(), "", "=", "", delimiter, shell_family)
}

pub fn export_variables_for_shell(&self, shell_type: ShellType) -> String {
Expand Down Expand Up @@ -264,17 +264,17 @@ pub fn serialize_variables_for_shell<'s, I: IntoIterator<Item = (&'s str, &'s En
// Prefix — what's prepended to each variable
// Separator — what separates the variable name from the value
// Postfix — what's appended to the end of each variable
// Delimeter — what separates one variable from the next one
// Delimiter — what separates one variable from the next one
// set -x var_name var_value; set -x name2 value2;
// ------ - - -
// ^ ^ ^ ^
// prefix separator postfix delimeter (in this case 4 spaces, usually one space or newline)
// prefix separator postfix delimiter (in this case 4 spaces, usually one space or newline)
fn serialize_variables_internal<'s, I: IntoIterator<Item = (&'s str, &'s EnvVarValue)>>(
pairs: I,
prefix: &str,
separator: &str,
postfix: &str,
delimeter: &str,
delimiter: &str,
shell_family: ShellFamily,
) -> String {
pairs
Expand All @@ -290,5 +290,5 @@ fn serialize_variables_internal<'s, I: IntoIterator<Item = (&'s str, &'s EnvVarV
)
})
.collect_vec()
.join(delimeter)
.join(delimiter)
}
6 changes: 3 additions & 3 deletions app/src/external_secrets/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ use crate::{terminal::shell::ShellType, ui_components::icons::Icon};
lazy_static! {
// Used as a delimeter to separate metadata (such as names and references)
// in cases the cli tool doesn't display secrets in a common format (i.e. json)
static ref WARP_SECRET_DELIMETER: &'static str = "/warp-secret-delimeter/";
static ref WARP_SECRET_DELIMITER: &'static str = "/warp-secret-delimeter/";
static ref LASTPASS_LIST_SECRETS_COMMAND: Vec<String> = {
vec![
"lpass".to_owned(),
"ls".to_owned(),
format!("--format=%an{}%ai", *WARP_SECRET_DELIMETER),
format!("--format=%an{}%ai", *WARP_SECRET_DELIMITER),
]
};
}
Expand Down Expand Up @@ -320,7 +320,7 @@ fn parse_lastpass_secrets(output: &str) -> anyhow::Result<Vec<ExternalSecret>> {
let parsed_output: Vec<ExternalSecret> = output
.lines()
.filter_map(|line| {
let parts = line.split(*WARP_SECRET_DELIMETER).collect_vec();
let parts = line.split(*WARP_SECRET_DELIMITER).collect_vec();
if parts.len() == 2 && !parts[0].is_empty() && !parts[1].is_empty() {
Some(ExternalSecret::LastPass(LastPassSecret {
name: parts[0].to_owned(),
Expand Down
Loading