mirror of
https://github.com/mifi/lossless-cut.git
synced 2024-11-22 02:12:30 +01:00
Fix env detection
It was not working..
Use Sindre's module 🦄
This commit is contained in:
parent
fd03dcc139
commit
b622df997e
@ -46,6 +46,7 @@
|
|||||||
"classnames": "^2.2.5",
|
"classnames": "^2.2.5",
|
||||||
"electron": "^1.4.5",
|
"electron": "^1.4.5",
|
||||||
"electron-default-menu": "^1.0.0",
|
"electron-default-menu": "^1.0.0",
|
||||||
|
"electron-is-dev": "^0.1.2",
|
||||||
"execa": "^0.5.0",
|
"execa": "^0.5.0",
|
||||||
"file-type": "^3.9.0",
|
"file-type": "^3.9.0",
|
||||||
"jquery": "^3.1.1",
|
"jquery": "^3.1.1",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
const electron = require('electron'); // eslint-disable-line
|
const electron = require('electron'); // eslint-disable-line
|
||||||
|
const isDev = require('electron-is-dev');
|
||||||
|
|
||||||
const util = require('./util');
|
|
||||||
const menu = require('./menu');
|
const menu = require('./menu');
|
||||||
|
|
||||||
const app = electron.app;
|
const app = electron.app;
|
||||||
@ -8,7 +8,7 @@ const BrowserWindow = electron.BrowserWindow;
|
|||||||
|
|
||||||
app.setName('LosslessCut');
|
app.setName('LosslessCut');
|
||||||
|
|
||||||
if (util.isPackaged()) process.env.NODE_ENV = 'production';
|
if (!isDev) process.env.NODE_ENV = 'production';
|
||||||
|
|
||||||
// Keep a global reference of the window object, if you don't, the window will
|
// Keep a global reference of the window object, if you don't, the window will
|
||||||
// be closed automatically when the JavaScript object is garbage collected.
|
// be closed automatically when the JavaScript object is garbage collected.
|
||||||
|
@ -14,12 +14,6 @@ function formatDuration(_seconds) {
|
|||||||
return `${hoursPadded}.${minutesPadded}.${secondsPadded}.${msPadded}`;
|
return `${hoursPadded}.${minutesPadded}.${secondsPadded}.${msPadded}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
function isPackaged() {
|
|
||||||
// http://stackoverflow.com/questions/39362292/how-do-i-set-node-env-production-on-electron-app-when-packaged-with-electron-pac
|
|
||||||
return process.execPath.search('electron-prebuilt') === -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
formatDuration,
|
formatDuration,
|
||||||
isPackaged,
|
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user