Skip to content

Commit

Permalink
This $PATH should be wrapped in quotes so it will work with spaces (#…
Browse files Browse the repository at this point in the history
…1066)

* This $PATH should be wrapped in quotes so it will work with spaces

* patch changeset for 1066

---------

Co-authored-by: Gal Schlezinger <gal@spitfire.co.il>
  • Loading branch information
floh1695 and Schniz authored May 27, 2024
1 parent 6be23c8 commit 9ff98da
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/violet-rice-brake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"fnm": patch
---

Fixes a bug when running `eval $(fnm env)` in sh when there a spaces in the $PATH
2 changes: 1 addition & 1 deletion src/shell/bash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ impl Shell for Bash {
.ok_or_else(|| anyhow::anyhow!("Can't convert path to string"))?;
let path =
super::windows_compat::maybe_fix_windows_path(path).unwrap_or_else(|| path.to_string());
Ok(format!("export PATH={path:?}:$PATH"))
Ok(format!("export PATH={path:?}:\"$PATH\""))
}

fn set_env_var(&self, name: &str, value: &str) -> String {
Expand Down

0 comments on commit 9ff98da

Please sign in to comment.