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() {
  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;