Browse Source

This $PATH should be wrapped in quotes so it will work with spaces (#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>
remotes/origin/use-bnz
Charles Bayley 9 months ago committed by GitHub
parent
commit
9ff98da93c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 5
      .changeset/violet-rice-brake.md
  2. 2
      src/shell/bash.rs

5
.changeset/violet-rice-brake.md

@ -0,0 +1,5 @@
---
"fnm": patch
---
Fixes a bug when running `eval $(fnm env)` in sh when there a spaces in the $PATH

2
src/shell/bash.rs

@ -18,7 +18,7 @@ impl Shell for Bash {
.ok_or_else(|| anyhow::anyhow!("Can't convert path to string"))?; .ok_or_else(|| anyhow::anyhow!("Can't convert path to string"))?;
let path = let path =
super::windows_compat::maybe_fix_windows_path(path).unwrap_or_else(|| path.to_string()); 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 { fn set_env_var(&self, name: &str, value: &str) -> String {

Loading…
Cancel
Save