diff --git a/commands/cli/parse.go b/commands/cli/parse.go index 2ac455f75..680fa466e 100644 --- a/commands/cli/parse.go +++ b/commands/cli/parse.go @@ -405,8 +405,6 @@ const notRecursiveFmtStr = "'%s' is a directory, use the '-%s' flag to specify d const dirNotSupportedFmtStr = "Invalid path '%s', argument '%s' does not support directories" func appendFile(fpath string, argDef *cmds.Argument, recursive, hidden bool) (files.File, error) { - fpath = filepath.ToSlash(filepath.Clean(fpath)) - if fpath == "." { cwd, err := os.Getwd() if err != nil { @@ -415,6 +413,8 @@ func appendFile(fpath string, argDef *cmds.Argument, recursive, hidden bool) (fi fpath = cwd } + fpath = filepath.ToSlash(filepath.Clean(fpath)) + stat, err := os.Lstat(fpath) if err != nil { return nil, err