Skip to content

Commit

Permalink
fix(nu): format values in Path
Browse files Browse the repository at this point in the history
  • Loading branch information
RuiNtD authored Aug 28, 2023
1 parent cb4533f commit a0e5eb2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/shell/nu.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func (e *Env) nu() *Env {
}

func (p *Path) nu() *Path {
template := `$env.%s = ($env.%s | prepend "{{ .Value }}")`
template := `$env.%s = ($env.%s | prepend {{ formatString .Value }})`
pathName := "PATH"

if context.Current.OS == context.WINDOWS {
Expand Down
6 changes: 3 additions & 3 deletions src/shell/path_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ $env.PATH = ($env.PATH | prepend "/usr/bin")`,
Case: "NU - Windows",
Shell: NU,
OS: context.WINDOWS,
Path: &Path{Value: "/usr/local/bin\n/usr/bin"},
Expected: `$env.Path = ($env.Path | prepend "/usr/local/bin")
$env.Path = ($env.Path | prepend "/usr/bin")`,
Path: &Path{Value: "C:\\bin\nD:\\bin"},
Expected: `$env.Path = ($env.Path | prepend "C:\\bin")
$env.Path = ($env.Path | prepend "D:\\bin")`,
},
{
Case: "TCSH - single item",
Expand Down

0 comments on commit a0e5eb2

Please sign in to comment.