fix manager crash when GPD outdated on some npm versions

This commit is contained in:
Wingy 2022-02-16 14:14:58 -05:00
parent eecd11a431
commit a81c98112b

View file

@ -4,7 +4,7 @@ const { spawn } = require('child_process')
const PACKAGENAME = 'get-product-name' const PACKAGENAME = 'get-product-name'
async function isOutdated () { async function isOutdated () {
const command = `npm outdated ${PACKAGENAME} --json` const command = `npm outdated ${PACKAGENAME} --json || true`
const npm = await exec(command) const npm = await exec(command)
const data = JSON.parse(npm.stdout) const data = JSON.parse(npm.stdout)
return data[PACKAGENAME]?.current !== data[PACKAGENAME]?.wanted return data[PACKAGENAME]?.current !== data[PACKAGENAME]?.wanted