Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 586e7cb

Browse files
committed
WIP
1 parent f18768b commit 586e7cb

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

agent/agent.go

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1406,20 +1406,13 @@ func expandDirectory(dir string) (string, error) {
14061406
return "", err
14071407
}
14081408
dir = filepath.Join(home, dir[1:])
1409-
1410-
} else if !filepath.IsAbs(dir) {
1411-
// If the directory is not absolute, we assume it is relative to the
1412-
// user's home directory.
1409+
}
1410+
if !filepath.IsAbs(dir) {
14131411
home, err := userHomeDir()
14141412
if err != nil {
14151413
return "", err
14161414
}
14171415
dir = filepath.Join(home, dir)
1418-
1419-
} else {
1420-
// If the directory is absolute, we assume it is an absolute path.
1421-
// We do not check if the directory exists.
1422-
return dir, nil
14231416
}
14241417
return os.ExpandEnv(dir), nil
14251418
}

0 commit comments

Comments
 (0)