Merge pull request #3 from CodinCat/patch-1
fix cd command without any argument
This commit is contained in:
commit
a6d92f4a12
6
eval.go
6
eval.go
@ -195,7 +195,11 @@ func (e *CallExpr) eval(app *App, args []string) {
|
|||||||
app.nav.top()
|
app.nav.top()
|
||||||
app.ui.echoFileInfo(app.nav)
|
app.ui.echoFileInfo(app.nav)
|
||||||
case "cd":
|
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()
|
app.ui.message = err.Error()
|
||||||
log.Print(err)
|
log.Print(err)
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user