From 5566f82596a35be06a120f2af96ff510d6cbf315 Mon Sep 17 00:00:00 2001 From: SPFabGerman <42518661+SPFabGerman@users.noreply.github.com> Date: Wed, 25 Aug 2021 17:57:17 +0200 Subject: [PATCH] fixed bug, where ~ is not a absolute directory (#690) --- eval.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/eval.go b/eval.go index d46a8c9..d6d0247 100644 --- a/eval.go +++ b/eval.go @@ -881,6 +881,7 @@ func (e *callExpr) eval(app *app, args []string) { } else { dir := app.nav.currDir() for _, path := range e.args { + path = replaceTilde(path) if !filepath.IsAbs(path) { path = filepath.Join(dir.path, path) } @@ -1173,6 +1174,7 @@ func (e *callExpr) eval(app *app, args []string) { log.Printf("getting current directory: %s", err) } + path = replaceTilde(path) if !filepath.IsAbs(path) { path = filepath.Join(wd, path) } else { @@ -1206,7 +1208,7 @@ func (e *callExpr) eval(app *app, args []string) { log.Printf("getting current directory: %s", err) } - path := filepath.Dir(e.args[0]) + path := filepath.Dir(replaceTilde(e.args[0])) if !filepath.IsAbs(path) { path = filepath.Join(wd, path) } else { @@ -1528,7 +1530,7 @@ func (e *callExpr) eval(app *app, args []string) { oldPath := filepath.Join(wd, curr.Name()) - newPath := filepath.Clean(s) + newPath := filepath.Clean(replaceTilde(s)) if !filepath.IsAbs(newPath) { newPath = filepath.Join(wd, newPath) }