Skip to content

Commit

Permalink
Hotfix (v0.1.8)
Browse files Browse the repository at this point in the history
- Fix: `mure init --shell` doesn't output with correct shell syntax.
  • Loading branch information
kitsuyui committed Aug 31, 2022
1 parent 97d0c20 commit 969187d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mure"
version = "0.1.7"
version = "0.1.8"
edition = "2021"
authors = ["Yui Kitsu <[email protected]>"]
description = "A command line tool for creating and managing multiple repositories."
Expand Down
7 changes: 5 additions & 2 deletions src/app/path/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub fn shell_shims(config: &Config) -> String {

fn shell_shims_for_cd_directly(bin_name: &str, fn_name: &str) -> String {
format!(
"{fn_name} {{ local p=$({bin_name} path \"$1\") && cd \"$p\" }}\n",
"function {fn_name}() {{ local p=$({bin_name} path \"$1\") && cd \"$p\" }}\n",
fn_name = fn_name,
bin_name = bin_name
)
Expand Down Expand Up @@ -71,6 +71,9 @@ mod tests {
#[test]
fn test_shell_shims() {
let shims = shell_shims_for_cd_directly("mure", "mcd");
assert_eq!(shims, "mcd { local p=$(mure path \"$1\") && cd \"$p\" }\n");
assert_eq!(
shims,
"function mcd() { local p=$(mure path \"$1\") && cd \"$p\" }\n"
);
}
}

0 comments on commit 969187d

Please sign in to comment.