mirror of
https://github.com/Llewellynvdm/nativefier.git
synced 2024-12-23 10:38:55 +00:00
1. Fix (broken since 2016): Notifications broken by lambda constructor 2. Fix: `--processEnvs` broken by additional processEnvs object, the result was: `processEnvs: {processEnvs: {...}}` which caused the conversion of the inner object into string `[object Object]`, no nesting allowed there probably. Compatibility introduced. 3. Fix: package.json missing `prepare` (or even prepublish), which breaks using as git dependency.
This commit is contained in:
parent
9ccda87938
commit
1d3bed5f09
@ -24,11 +24,16 @@ const fileDownloadOptions = { ...appArgs.fileDownloadOptions };
|
|||||||
electronDownload(fileDownloadOptions);
|
electronDownload(fileDownloadOptions);
|
||||||
|
|
||||||
if (appArgs.processEnvs) {
|
if (appArgs.processEnvs) {
|
||||||
|
// 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) => {
|
Object.keys(appArgs.processEnvs).forEach((key) => {
|
||||||
/* eslint-env node */
|
/* eslint-env node */
|
||||||
process.env[key] = appArgs.processEnvs[key];
|
process.env[key] = appArgs.processEnvs[key];
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let mainWindow;
|
let mainWindow;
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ const INJECT_JS_PATH = path.join(__dirname, '..', 'inject/inject.js');
|
|||||||
*/
|
*/
|
||||||
function setNotificationCallback(createCallback, clickCallback) {
|
function setNotificationCallback(createCallback, clickCallback) {
|
||||||
const OldNotify = window.Notification;
|
const OldNotify = window.Notification;
|
||||||
const newNotify = (title, opt) => {
|
const newNotify = function (title, opt) {
|
||||||
createCallback(title, opt);
|
createCallback(title, opt);
|
||||||
const instance = new OldNotify(title, opt);
|
const instance = new OldNotify(title, opt);
|
||||||
instance.addEventListener('click', clickCallback);
|
instance.addEventListener('click', clickCallback);
|
||||||
|
@ -42,6 +42,7 @@
|
|||||||
"lint:format": "prettier --write 'src/**/*.js' 'app/src/**/*.js'",
|
"lint:format": "prettier --write 'src/**/*.js' 'app/src/**/*.js'",
|
||||||
"lint": "eslint . --ext .ts",
|
"lint": "eslint . --ext .ts",
|
||||||
"list-outdated-deps": "npm out; cd app && npm out; true",
|
"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:integration": "jest --testRegex '.*integration-test.js'",
|
||||||
"test:manual": "npm run build && ./docs/manual-test",
|
"test:manual": "npm run build && ./docs/manual-test",
|
||||||
"test:unit": "jest",
|
"test:unit": "jest",
|
||||||
|
@ -52,7 +52,7 @@ function getProcessEnvs(val: string): any {
|
|||||||
if (!val) {
|
if (!val) {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
return { processEnvs: parseJson(val) };
|
return parseJson(val);
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkInternet(): void {
|
function checkInternet(): void {
|
||||||
|
Loading…
Reference in New Issue
Block a user