Skip to content

Commit

Permalink
fix for cd home with a tilda
Browse files Browse the repository at this point in the history
  • Loading branch information
gokcehan committed Aug 14, 2016
1 parent bc4c3c1 commit 5df5c23
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nav.go
Original file line number Diff line number Diff line change
Expand Up @@ -320,12 +320,12 @@ func (nav *Nav) top() {
}

func (nav *Nav) cd(wd string) error {
wd = strings.Replace(wd, "~", envHome, -1)

if !path.IsAbs(wd) {
wd = path.Join(nav.currDir().path, wd)
}

wd = strings.Replace(wd, "~", envHome, -1)

err := os.Chdir(wd)
if err != nil {
return fmt.Errorf("cd: %s", err)
Expand Down

0 comments on commit 5df5c23

Please sign in to comment.