app/config/app-info.js

27 lines
822 B
JavaScript
Raw Normal View History

2018-08-15 11:14:23 +00:00
const fse = require('fs-extra');
const path = require('path');
const { getUpdatesURL, getReleaseChannel } = require('./distribution-info');
const projectRoot = path.dirname(__dirname, '..');
const channel = getReleaseChannel();
function getReplacements() {
return {
__DARWIN__: process.platform === 'darwin',
__WIN32__: process.platform === 'win32',
__LINUX__: process.platform === 'linux',
__DEV__: channel === 'development',
2018-10-03 17:20:12 +00:00
__RELEASE_CHANNEL__: JSON.stringify(channel),
__UPDATES_URL__: JSON.stringify(getUpdatesURL()),
'process.platform': JSON.stringify(process.platform),
'process.env.NODE_ENV': JSON.stringify(
process.env.NODE_ENV || 'development'
),
'process.env.TEST_ENV': JSON.stringify(process.env.TEST_ENV)
};
2018-08-15 11:14:23 +00:00
}
2018-10-03 17:20:12 +00:00
exports.getReplacements = getReplacements;