diff --git a/app/src/main.ts b/app/src/main.ts index 28dead4..6fedc48 100644 --- a/app/src/main.ts +++ b/app/src/main.ts @@ -24,10 +24,15 @@ const fileDownloadOptions = { ...appArgs.fileDownloadOptions }; electronDownload(fileDownloadOptions); if (appArgs.processEnvs) { - Object.keys(appArgs.processEnvs).forEach((key) => { - /* eslint-env node */ - process.env[key] = appArgs.processEnvs[key]; - }); + // This is compatibility if just a string was passed. + if (typeof appArgs.processEnvs === 'string') { + process.env.processEnvs = appArgs.processEnvs; + } else { + Object.keys(appArgs.processEnvs).forEach((key) => { + /* eslint-env node */ + process.env[key] = appArgs.processEnvs[key]; + }); + } } let mainWindow; diff --git a/app/src/preload.ts b/app/src/preload.ts index 52c437b..f1832aa 100644 --- a/app/src/preload.ts +++ b/app/src/preload.ts @@ -22,7 +22,7 @@ const INJECT_JS_PATH = path.join(__dirname, '..', 'inject/inject.js'); */ function setNotificationCallback(createCallback, clickCallback) { const OldNotify = window.Notification; - const newNotify = (title, opt) => { + const newNotify = function (title, opt) { createCallback(title, opt); const instance = new OldNotify(title, opt); instance.addEventListener('click', clickCallback); diff --git a/package.json b/package.json index 3591948..9d1c2da 100644 --- a/package.json +++ b/package.json @@ -42,6 +42,7 @@ "lint:format": "prettier --write 'src/**/*.js' 'app/src/**/*.js'", "lint": "eslint . --ext .ts", "list-outdated-deps": "npm out; cd app && npm out; true", + "prepare": "cd ./app && npm install && cd .. && npm run build", "test:integration": "jest --testRegex '.*integration-test.js'", "test:manual": "npm run build && ./docs/manual-test", "test:unit": "jest", diff --git a/src/cli.ts b/src/cli.ts index 4a9b137..35936cf 100755 --- a/src/cli.ts +++ b/src/cli.ts @@ -52,7 +52,7 @@ function getProcessEnvs(val: string): any { if (!val) { return {}; } - return { processEnvs: parseJson(val) }; + return parseJson(val); } function checkInternet(): void {