app/config/app-info.js

27 lines
809 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();
const s = JSON.stringify;
function getReplacements() {
2018-09-27 09:44:56 +00:00
console.log(`channel: ${channel}`);
2018-08-15 11:14:23 +00:00
return {
__DARWIN__: process.platform === 'darwin',
__WIN32__: process.platform === 'win32',
__LINUX__: process.platform === 'linux',
__DEV__: channel === 'development',
__RELEASE_CHANNEL__: s(channel),
__UPDATES_URL__: s(getUpdatesURL()),
'process.platform': s(process.platform),
'process.env.NODE_ENV': s(process.env.NODE_ENV || 'development'),
'process.env.TEST_ENV': s(process.env.TEST_ENV),
}
}
exports.getReplacements = getReplacements;