Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export default async () => {
const housekeeper = new Housekeeper(getIOContext(), IOClientOptions)
const getSpinner = ora('Getting available updates').start()
const resolvedUpdates = await housekeeper.resolve()
getSpinner.stop()
if (!hasAvailableUpdates(resolvedUpdates)) {
log.info('No updates available')
return
}
printUpdates(resolvedUpdates)
const confirm = await promptUpdate()
if (!confirm) {
return
}
const applySpinner = ora('Applying updates').start()
await housekeeper.apply(resolvedUpdates)
applySpinner.stop()
}
export default async () => {
const housekeeper = new Housekeeper(getIOContext(), IOClientOptions)
const getSpinner = ora('Getting available updates').start()
const resolvedUpdates = await housekeeper.resolve()
getSpinner.stop()
const hasAvailableUpdates =
printAppsDiff(resolvedUpdates, `The following infra apps will be updated`, ['infra']) ||
printAppsDiff(resolvedUpdates, `The following installed apps will be updated:`, ['apps'], sourceFilter('installation'), pluck('id')) ||
printAppsDiff(resolvedUpdates, `The following dependencies will be updated:`, ['apps'], sourceFilter('dependency'), pluck('id')) ||
printAppsDiff(resolvedUpdates, `The following edition apps will be updated`, ['apps'], sourceFilter('edition'), pluck('id')) ||
printEditionAppsDiff(resolvedUpdates)
if (!hasAvailableUpdates) {
log.info('No updates available')
}
const confirm = await promptUpdate()
if (!confirm) {
return