mirror of
https://github.com/atom/atom.git
synced 2026-01-25 06:48:28 -05:00
20 lines
423 B
JavaScript
20 lines
423 B
JavaScript
'use strict'
|
|
|
|
const glob = require('glob')
|
|
|
|
module.exports = function (globPaths) {
|
|
return Promise.all(globPaths.map(g => expandGlobPath(g))).then(paths => paths.reduce((a, b) => a.concat(b), []))
|
|
}
|
|
|
|
function expandGlobPath (globPath) {
|
|
return new Promise((resolve, reject) => {
|
|
glob(globPath, (error, paths) => {
|
|
if (error) {
|
|
reject(error)
|
|
} else {
|
|
resolve(paths)
|
|
}
|
|
})
|
|
})
|
|
}
|