1
1
mirror of https://github.com/primer/css.git synced 2024-12-24 14:42:26 +03:00

fix script/get-packages

This commit is contained in:
Shawn Allen 2019-01-02 21:51:23 -08:00
parent 924a9758f6
commit 290f87711e

View File

@ -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
}
})
})