Merge pull request #3 from CodinCat/patch-1

fix cd command without any argument
This commit is contained in:
gokcehan 2016-08-19 12:10:16 +03:00 committed by GitHub
commit a6d92f4a12

View File

@ -195,7 +195,11 @@ func (e *CallExpr) eval(app *App, args []string) {
app.nav.top()
app.ui.echoFileInfo(app.nav)
case "cd":
if err := app.nav.cd(e.args[0]); err != nil {
path := "~"
if len(e.args) > 0 {
path = e.args[0]
}
if err := app.nav.cd(path); err != nil {
app.ui.message = err.Error()
log.Print(err)
return