Skip to content

Commit

Permalink
Refactor adding to the output string
Browse files Browse the repository at this point in the history
  • Loading branch information
superatomic committed Apr 24, 2022
1 parent fee106b commit 42c9952
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,17 +250,17 @@ fn to_shell_source(vars: &EnvironmentVariables, shell: &Shell) -> String {
};

// Select the correct form for the chosen shell.
match shell {
output += &match shell {
Shell::Bash | Shell::Zsh => {
output += &*format!("export {}=\"{}\";\n", name, value);
format!("export {}=\"{}\";\n", name, value)
}
Shell::Fish => {
// Add `--path` to the variable if the variable was represented as a list in the TOML.
let path = match is_path {
true => " --path",
false => "",
};
output += &*format!("set -gx{path} {} \"{}\";\n", name, value, path = path);
format!("set -gx{path} {} \"{}\";\n", name, value, path = path)
}
};
}
Expand Down

0 comments on commit 42c9952

Please sign in to comment.