Files
simplelogin-browser-extension/scripts/generateBuildConfig.js
T

22 lines
562 B
JavaScript
Raw Normal View History

2022-06-17 12:43:30 +02:00
const fs = require('fs');
const path = require('path');
const PATH = path.join(__dirname, '../src', 'popup', 'buildConfig.json');
2022-08-01 09:49:58 +02:00
const isLoginWithProtonEnabled = () => {
const enableLoginWithProton = process.env.ENABLE_LOGIN_WITH_PROTON;
if (enableLoginWithProton == undefined || enableLoginWithProton === 'true') {
return true;
}
return false;
};
2022-06-17 12:43:30 +02:00
const config = {
features: {
2022-08-01 09:49:58 +02:00
loginWithProtonEnabled: isLoginWithProtonEnabled()
2022-06-17 12:43:30 +02:00
},
buildTime: new Date().getTime()
};
2022-08-01 09:49:58 +02:00
fs.writeFileSync(PATH, JSON.stringify(config, null, 2));