fix for cd home with a tilda

This commit is contained in:
Gokcehan 2016-08-14 18:38:33 +03:00
parent bc4c3c127b
commit 5df5c23489

4
nav.go
View File

@ -320,12 +320,12 @@ func (nav *Nav) top() {
} }
func (nav *Nav) cd(wd string) error { func (nav *Nav) cd(wd string) error {
wd = strings.Replace(wd, "~", envHome, -1)
if !path.IsAbs(wd) { if !path.IsAbs(wd) {
wd = path.Join(nav.currDir().path, wd) wd = path.Join(nav.currDir().path, wd)
} }
wd = strings.Replace(wd, "~", envHome, -1)
err := os.Chdir(wd) err := os.Chdir(wd)
if err != nil { if err != nil {
return fmt.Errorf("cd: %s", err) return fmt.Errorf("cd: %s", err)