Skip to content

Commit

Permalink
#143: uninstall separate xpack dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
ilg-ul committed Aug 14, 2022
1 parent 9bb1029 commit 5541e1a
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lib/xpm/uninstall.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const del = require('del')

const { FsUtils } = require('../utils/fs-utils.js')
const { GlobalConfig } = require('../utils/global-config.js')
const { Policies } = require('../utils/policies.js')
const { Xpack } = require('../utils/xpack.js')

// https://www.npmjs.com/package/@xpack/xpm-liquid
Expand Down Expand Up @@ -197,7 +198,8 @@ class Uninstall extends CliCommand {
throw new CliError('system uninstall not yet implemented')
}

await xpack.checkMinimumXpmRequired(packageJson)
const minVersion = await xpack.checkMinimumXpmRequired(packageJson)
this.policies = new Policies(minVersion, context)

for (const arg of args) {
if (config.isSystem) {
Expand Down Expand Up @@ -499,7 +501,12 @@ class Uninstall extends CliCommand {
configurationName: config.configurationName
})
} else {
target = packageJson
if (this.policies.shareNpmDependencies) {
target = packageJson
} else {
// Starting with 0.14.x, dependencies are below xpack.
target = packageJson.xpack
}
}

if (target.dependencies && target.dependencies[key]) {
Expand Down

0 comments on commit 5541e1a

Please sign in to comment.