fixed bug, where ~ is not a absolute directory (#690)
This commit is contained in:
parent
0edf0823b7
commit
5566f82596
6
eval.go
6
eval.go
@ -881,6 +881,7 @@ func (e *callExpr) eval(app *app, args []string) {
|
|||||||
} else {
|
} else {
|
||||||
dir := app.nav.currDir()
|
dir := app.nav.currDir()
|
||||||
for _, path := range e.args {
|
for _, path := range e.args {
|
||||||
|
path = replaceTilde(path)
|
||||||
if !filepath.IsAbs(path) {
|
if !filepath.IsAbs(path) {
|
||||||
path = filepath.Join(dir.path, 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)
|
log.Printf("getting current directory: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
path = replaceTilde(path)
|
||||||
if !filepath.IsAbs(path) {
|
if !filepath.IsAbs(path) {
|
||||||
path = filepath.Join(wd, path)
|
path = filepath.Join(wd, path)
|
||||||
} else {
|
} else {
|
||||||
@ -1206,7 +1208,7 @@ func (e *callExpr) eval(app *app, args []string) {
|
|||||||
log.Printf("getting current directory: %s", err)
|
log.Printf("getting current directory: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
path := filepath.Dir(e.args[0])
|
path := filepath.Dir(replaceTilde(e.args[0]))
|
||||||
if !filepath.IsAbs(path) {
|
if !filepath.IsAbs(path) {
|
||||||
path = filepath.Join(wd, path)
|
path = filepath.Join(wd, path)
|
||||||
} else {
|
} else {
|
||||||
@ -1528,7 +1530,7 @@ func (e *callExpr) eval(app *app, args []string) {
|
|||||||
|
|
||||||
oldPath := filepath.Join(wd, curr.Name())
|
oldPath := filepath.Join(wd, curr.Name())
|
||||||
|
|
||||||
newPath := filepath.Clean(s)
|
newPath := filepath.Clean(replaceTilde(s))
|
||||||
if !filepath.IsAbs(newPath) {
|
if !filepath.IsAbs(newPath) {
|
||||||
newPath = filepath.Join(wd, newPath)
|
newPath = filepath.Join(wd, newPath)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user