Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f18768b commit 586e7cbCopy full SHA for 586e7cb
agent/agent.go
@@ -1406,20 +1406,13 @@ func expandDirectory(dir string) (string, error) {
1406
return "", err
1407
}
1408
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.
+ }
+ if !filepath.IsAbs(dir) {
1413
home, err := userHomeDir()
1414
if err != nil {
1415
1416
1417
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
1423
1424
return os.ExpandEnv(dir), nil
1425
0 commit comments