Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
extraObj = extra
} else {
// Local file path to json file or json string.
// In that case, the extra property set for this publisher
// in Cauldron, will be the the json string, or the
// content of the json file, as such
// For example :
// "extra": {
// "artifactId": "app-container",
// "groupId": "com.company.app"
// }
extraObj = await parseJsonFromStringOrFile(extra)
}
}
const p: ContainerPublisher = await getPublisher(publisher)
if (descriptor && !p.platforms.includes(descriptor.platform!)) {
throw new Error(
`The ${p.name} publisher does not support ${descriptor.platform} platform`
)
}
await cauldron.addPublisher(publisher, p.platforms, descriptor, url, extraObj)
log.info(`${publisher} publisher successfully added to ${descriptor}`)
}