mirror of
https://github.com/primer/css.git
synced 2024-12-25 07:03:35 +03:00
fix script/get-packages
This commit is contained in:
parent
924a9758f6
commit
290f87711e
@ -5,16 +5,21 @@ const {join} = require('path')
|
||||
|
||||
const getPackages = (debug = false) => {
|
||||
const lernaConfig = require('../lerna.json')
|
||||
const packageGlobs = lernaConfig.packages
|
||||
const packageGlobs = lernaConfig.packages.concat('!**/*.md')
|
||||
return globby(packageGlobs)
|
||||
.then(packagePaths => {
|
||||
if (debug) {
|
||||
console.warn(`Filtering ${packagePaths.length} paths...`)
|
||||
}
|
||||
return packagePaths.filter(pkg => {
|
||||
try {
|
||||
require.resolve(join('..', pkg, 'package.json'))
|
||||
return true
|
||||
} catch (error) {
|
||||
if (debug) {
|
||||
console.warn(`No package.json in ${pkg}: ${error}`)
|
||||
}
|
||||
return false
|
||||
}
|
||||
})
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user