diff --git a/cli/parse.go b/cli/parse.go index e5995716..96ac22da 100644 --- a/cli/parse.go +++ b/cli/parse.go @@ -456,6 +456,7 @@ 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 *cmdkit.Argument, recursive, hidden bool) (files.File, error) { + fpath = filepath.ToSlash(filepath.Clean(fpath)) if fpath == "." { cwd, err := os.Getwd() if err != nil { @@ -468,8 +469,6 @@ func appendFile(fpath string, argDef *cmdkit.Argument, recursive, hidden bool) ( fpath = cwd } - fpath = filepath.ToSlash(filepath.Clean(fpath)) - stat, err := os.Lstat(fpath) if err != nil { return nil, err