Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Commit 9c29a23

Browse files
richardschneiderdaviddias
authored andcommittedNov 26, 2017
fix(files.add): glob needs a POSIX path (#1108)
1 parent 70b8cd7 commit 9c29a23

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed
 

‎src/cli/commands/files/add.js

+8-3
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,18 @@ function checkPath (inPath, recursive) {
2929
throw new Error('Error: Argument \'path\' is required')
3030
}
3131

32-
// Strips trailing slash from path.
33-
inPath = inPath.replace(/\/$/, '')
34-
3532
if (inPath === '.') {
3633
inPath = process.cwd()
3734
}
3835

36+
// Convert to POSIX format
37+
inPath = inPath
38+
.split(path.sep)
39+
.join('/')
40+
41+
// Strips trailing slash from path.
42+
inPath = inPath.replace(/\/$/, '')
43+
3944
if (fs.statSync(inPath).isDirectory() && recursive === false) {
4045
throw new Error(`Error: ${inPath} is a directory, use the '-r' flag to specify directories`)
4146
}

0 commit comments

Comments
 (0)
This repository has been archived.