Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async function reinitializePluginConfigs(options, flags = {}) {
const {workDir, output, env} = options
const localChecksums = await getChecksums(workDir)
const allPlugins = await resolveTree({basePath: workDir, env})
const pluginsWithDistConfig = (await Promise.all(allPlugins.map(pluginHasDistConfig))).filter(
Boolean
)
const distChecksums = await Promise.all(pluginsWithDistConfig.map(getPluginConfigChecksum))
const withLocalConfigs = await Promise.all(distChecksums.map(hasLocalConfig))
const missingConfigs = await Promise.all(withLocalConfigs.map(createMissingConfig))
const configPlugins = missingConfigs.map(warnOnDifferingChecksum)
return missingConfigs.length > 0 ? saveNewChecksums(configPlugins) : Promise.resolve()
function hasLocalConfig(plugin) {
return localConfigExists(workDir, plugin.name).then(configDeployed =>
Object.assign({}, plugin, {configDeployed})
)
}