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

Commit

Permalink
fix(files.add): glob needs a POSIX path (#1108)
Browse files Browse the repository at this point in the history
  • Loading branch information
richardschneider authored and daviddias committed Nov 26, 2017
1 parent 70b8cd7 commit 9c29a23
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/cli/commands/files/add.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,18 @@ function checkPath (inPath, recursive) {
throw new Error('Error: Argument \'path\' is required')
}

// Strips trailing slash from path.
inPath = inPath.replace(/\/$/, '')

if (inPath === '.') {
inPath = process.cwd()
}

// Convert to POSIX format
inPath = inPath
.split(path.sep)
.join('/')

// Strips trailing slash from path.
inPath = inPath.replace(/\/$/, '')

if (fs.statSync(inPath).isDirectory() && recursive === false) {
throw new Error(`Error: ${inPath} is a directory, use the '-r' flag to specify directories`)
}
Expand Down

0 comments on commit 9c29a23

Please sign in to comment.