From 5df5c234890d0dd42732d21a2b8d069c2c17bfaa Mon Sep 17 00:00:00 2001 From: Gokcehan Date: Sun, 14 Aug 2016 18:38:33 +0300 Subject: [PATCH] fix for cd home with a tilda --- nav.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nav.go b/nav.go index 84c59cc..794ab73 100644 --- a/nav.go +++ b/nav.go @@ -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)