Skip to content

Commit

Permalink
fix(cli): use updatePackage instead of installDeps
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume Chau committed Jan 24, 2019
1 parent 249700e commit 5c67f6d
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions packages/@nodepack/cli/src/lib/PluginUpgradeJob.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const {
chalk,
getPackageMetadata,
getPackageVersionsInfo,
writePkg,
updatePackage,
} = require('@nodepack/utils')
const officialPluginShorthands = require('../util/officialPluginShorthands')
const inquirer = require('inquirer')
Expand Down Expand Up @@ -63,7 +63,7 @@ module.exports = class PluginUpgradeJob {
cliOptions,
skipCommit: true,
skipPreInstall: true,
before: async ({ pkg, plugins, shouldCommitState, installDeps, isTestOrDebug }) => {
before: async ({ pkg, plugins, shouldCommitState, packageManager, isTestOrDebug }) => {
/** @type {string []} */
let selectedPlugins
if (packageNames.length) {
Expand Down Expand Up @@ -144,13 +144,11 @@ module.exports = class PluginUpgradeJob {

await shouldCommitState(`[nodepack] before update ${count} plugin${count > 1 ? 's' : ''}`, true)

for (const update of queuedUpdates) {
pkg[update.info.dependencyType][update.info.id] = update.version
}
writePkg(cwd, pkg)

if (!isTestOrDebug) {
await installDeps(`📦 Updating packages...`)
log(`📦 Upgrading packages...`)
await updatePackage(cwd, packageManager, cliOptions.registry, queuedUpdates.map(
u => `${u.info.id}@${u.version}`
).join(' '))
}
} else {
log(`${chalk.green('✔')} No plugin updates applied.`)
Expand Down

0 comments on commit 5c67f6d

Please sign in to comment.