Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (!updatedPlugins.length) {
notify({
title: `No updates available`,
message: `No plugin to update in the version ranges declared in package.json`,
icon: 'done'
})
return []
}
setProgress({
status: 'plugins-update',
args: [updatedPlugins.length]
})
await updatePackage(cwd.get(), getCommand(cwd.get()), null, updatedPlugins.map(
p => p.id
).join(' '))
notify({
title: `Plugins updated`,
message: `${updatedPlugins.length} plugin(s) were successfully updated`,
icon: 'done'
})
await resetPluginApi({ file: cwd.get() }, context)
return updatedPlugins
})
}
return progress.wrap('plugin-update', context, async setProgress => {
setProgress({
status: 'plugin-update',
args: [id]
})
currentPluginId = id
const plugin = findOne({ id, file: cwd.get() }, context)
const { current, wanted, localPath } = await dependencies.getVersion(plugin, context)
if (localPath) {
await updateLocalPackage({ cwd: cwd.get(), id, localPath, full }, context)
} else {
await updatePackage(cwd.get(), getCommand(cwd.get()), null, id)
}
logs.add({
message: `Plugin ${id} updated from ${current} to ${wanted}`,
type: 'info'
}, context)
notify({
title: `Plugin updated`,
message: `Plugin ${id} was successfully updated`,
icon: 'done'
})
await resetPluginApi({ file: cwd.get() }, context)
dependencies.invalidatePackage({ id }, context)