Fix dot path parsing on Windows
License: MIT Signed-off-by: Dominic Della Valle <ddvpublic@gmail.com>
Dominic Della Valle committed
Apr 28, 2016 at 02:21 UTC
af6e7ad9ea609c4d2bd4bf43341636a0ddbe9190
1 file changed
+2
-2
commands/cli/parse.go
+2
-2
@@ -405,8 +405,6 @@ const notRecursiveFmtStr = "'%s' is a directory, use the '-%s' flag to specify d
405
const dirNotSupportedFmtStr = "Invalid path '%s', argument '%s' does not support directories"
406
407
func appendFile(fpath string, argDef *cmds.Argument, recursive, hidden bool) (files.File, error) {
408
- fpath = filepath.ToSlash(filepath.Clean(fpath))
409
-
408
if fpath == "." {
409
cwd, err := os.Getwd()
410
if err != nil {
@@ -415,6 +413,8 @@ func appendFile(fpath string, argDef *cmds.Argument, recursive, hidden bool) (fi
413
fpath = cwd
414
}
415
416
+ fpath = filepath.ToSlash(filepath.Clean(fpath))
417
+
418
stat, err := os.Lstat(fpath)
419
if err != nil {
420
return nil, err