hack docker gpd update

This commit is contained in:
Wingy 2020-11-05 13:50:20 -05:00
parent 3f65ab3143
commit 44a3cc189c
2 changed files with 8 additions and 5 deletions

View file

@ -11,7 +11,8 @@ async function isOutdated() {
} }
async function updateGPD() { async function updateGPD() {
const command = `npm update ${PACKAGENAME}` // https://blog.cloud66.com/using-node-with-docker/
const command = `mv ./node_modules ./node_modules.tmp && mv ./node_modules.tmp ./node_modules && npm update ${PACKAGENAME}`
await exec(command) await exec(command)
} }
@ -27,7 +28,9 @@ async function updateGPD() {
if (process.env.UPDATE_GPD !== 'false') { if (process.env.UPDATE_GPD !== 'false') {
async function update() { async function update() {
if (await isOutdated()) { if (await isOutdated()) {
try {
await updateGPD() await updateGPD()
} catch {}
if (cc) cc.kill('sigint') if (cc) cc.kill('sigint')
cc.once('exit', () => console.log(`Updated ${PACKAGENAME}`)) cc.once('exit', () => console.log(`Updated ${PACKAGENAME}`))
} }

View file

@ -868,9 +868,9 @@
"tiny-each-async" "2.0.3" "tiny-each-async" "2.0.3"
"get-product-name@1": "get-product-name@1":
"integrity" "sha512-wGH86drg3fzsb5mjKpYpvUCqkX5M8L8edheao/wnaSW6aT7FO9m+2ZMwOTQgTFOGysSDotFRqu0WVQkatAfY4g==" "integrity" "sha512-EmxDzytXhHuWSZbOIKc7aDKaCpprvFw9DaTXLtaaiG+KXT7SCwZUQYdGY/0BWmQmu6xrmJWggih/13+syCjKzw=="
"resolved" "https://registry.npmjs.org/get-product-name/-/get-product-name-1.7.2.tgz" "resolved" "https://registry.npmjs.org/get-product-name/-/get-product-name-1.8.0.tgz"
"version" "1.7.2" "version" "1.8.0"
dependencies: dependencies:
"cheerio" "^1.0.0-rc.3" "cheerio" "^1.0.0-rc.3"
"child-process-promise" "^2.2.1" "child-process-promise" "^2.2.1"