diff --git a/package.json b/package.json index 729d62c..d8806e7 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,8 @@ "pkg": { "scripts": "build/**/*.js", "assets": [ - "public/**/*" + "public/**/*", + "build/vendor/**/*" ], "outputPath": "bin" }, diff --git a/scripts/build_only.sh b/scripts/build_only.sh index 52505a6..0f2e23d 100755 --- a/scripts/build_only.sh +++ b/scripts/build_only.sh @@ -6,4 +6,5 @@ echo "#!/usr/bin/env node" > build/diskernet.cjs cat build/out.cjs >> build/diskernet.cjs chmod +x build/diskernet.cjs +cp -r node_modules/ps-list-commonjs/vendor build/ diff --git a/src/app.js b/src/app.js index 7b9589a..a8236d1 100644 --- a/src/app.js +++ b/src/app.js @@ -64,7 +64,7 @@ async function start() { const list = await psList(); - chromeOpen = list.some(({name,cmd}) => name.match(/chrome/g) || cmd.match(/chrome/g)); + chromeOpen = list.some(({name,cmd}) => name?.match?.(/chrome/g) || cmd?.match?.(/chrome/g)); if ( chromeOpen ) { console.info(`Seems Chrome is open`); diff --git a/src/common.js b/src/common.js index af08f2c..f680f4c 100644 --- a/src/common.js +++ b/src/common.js @@ -3,10 +3,12 @@ import {fileURLToPath} from 'url'; import fs from 'fs'; import os from 'os'; +const DEEB = false; + export const DEBUG = { askFirst: true, - verboseSlow: false, - debug: process.env.DEBUG_22120 || false, + verboseSlow: process.env.VERBOSE_DEBUG_22120 || DEEB, + debug: process.env.DEBUG_22120 || DEEB, checkPred: false } export const SHOW_FETCH = false;