alfresco-ng2-components/scripts/app-config-replace.js
Eugenio Romano 27fa7a4725 [ADF-4957] Use Replace JS instead of sed to run e2e (#5160)
* use replace js

* Update app-config-replace.js

* update replace

* update replace

* fix folder
2019-10-28 16:51:36 +00:00

22 lines
780 B
JavaScript

// Protractor configuration file, see link for more information
// https://github.com/angular/protractor/blob/master/lib/config.ts
require('dotenv').config({ path: process.env.ENV_FILE });
const fs = require('fs');
const PROXY_HOST_ADF = process.env.PROXY_HOST_ADF;
const NOTIFICATION_LAST = process.env.NOTIFICATION_LAST || 8000;
const configPath = './demo-shell/dist/app.config.json';
fs.readFile(configPath, (err, appConfigString) => {
if (err) throw err;
let appConfig = JSON.parse(appConfigString);
appConfig.bpmHost = PROXY_HOST_ADF;
appConfig.ecmHost = PROXY_HOST_ADF;
appConfig.notificationDefaultDuration = NOTIFICATION_LAST;
let appConfigReplacedJson = JSON.stringify(appConfig);
fs.writeFileSync(configPath, appConfigReplacedJson);
});