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

Commit

Permalink
fix: fixes for windows
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Alan Shaw <alan.shaw@protocol.ai>
  • Loading branch information
Alan Shaw committed Dec 17, 2018
1 parent 384a9e6 commit 158d37d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/utils/files/glob-source.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ module.exports = (...args) => {

try {
const sources = results.map(res => toGlobSource(res, globSourceOptions))
return deferred.resolve(cat(sources))
deferred.resolve(cat(sources))
} catch (err) {
return deferred.abort(err)
deferred.abort(err)
}
})

Expand Down Expand Up @@ -94,7 +94,7 @@ function toGlobSource ({ path, type }, options) {
return pull(
pusher,
pull.map(p => ({
path: Path.join(baseName, p),
path: `${baseName}/${toPosix(p)}`,
contentPath: Path.join(path, p)
}))
)
Expand All @@ -107,8 +107,10 @@ function normalizePathWithType (path, cb) {
}, (err, res) => {
if (err) return cb(err)
cb(null, {
path: res.realpath.replace(/\\/g, '/'),
path: toPosix(res.realpath),
type: res.stat.isDirectory() ? 'dir' : 'file'
})
})
}

const toPosix = path => path.replace(/\\/g, '/')

0 comments on commit 158d37d

Please sign in to comment.