const fs = require('fs'); const devEnvironment = ` import {NgxLoggerLevel} from 'ngx-logger'; export const environment = { production: false, bloxbergChainId: ${process.env.CHAIN_ID || 8996}, level: NgxLoggerLevel.TRACE, serverLogLevel: NgxLoggerLevel.OFF, loggingUrl: ${process.env.LOGGING_URL || 'http://localhost:8000'}, cicMetaUrl: ${process.env.META_URL || 'https://meta.dev.grassrootseconomics.net'}, publicKeysUrl: ${process.env.KEYS_URL || 'http://localhost:8000/keys.asc'}, cicCacheUrl: ${process.env.META_URL || 'https://cache.dev.grassrootseconomics.net'}, web3Provider: ${process.env.WEB3_PROVIDER || 'ws://localhost:63546'}, cicUssdUrl: ${process.env.USSD_URL || 'https://ussd.dev.grassrootseconomics.net'}, registryAddress: ${process.env.REGISTRY_ADDRESS || '0x6Ca3cB14aA6F761712E1C18646AfBA4d5Ae249E8'}, trustedDeclaratorAddress: ${process.env.TRUSTED_ADDRESS || '0xEb3907eCad74a0013c259D5874AE7f22DcBcC95C'} }; `; const prodEnvironment = ` import {NgxLoggerLevel} from 'ngx-logger'; export const environment = { production: false, bloxbergChainId: ${process.env.CHAIN_ID || 8996}, level: NgxLoggerLevel.TRACE, serverLogLevel: NgxLoggerLevel.OFF, loggingUrl: ${process.env.LOGGING_URL || 'http://localhost:8000'}, cicMetaUrl: ${process.env.META_URL || 'https://meta.grassrootseconomics.net'}, publicKeysUrl: ${process.env.KEYS_URL || 'http://localhost:8000/keys.asc'}, cicCacheUrl: ${process.env.META_URL || 'https://cache.grassrootseconomics.net'}, web3Provider: ${process.env.WEB3_PROVIDER || 'ws://localhost:63546'}, cicUssdUrl: ${process.env.USSD_URL || 'https://ussd.grassrootseconomics.net'}, registryAddress: ${process.env.REGISTRY_ADDRESS || '0x6Ca3cB14aA6F761712E1C18646AfBA4d5Ae249E8'}, trustedDeclaratorAddress: ${process.env.TRUSTED_ADDRESS || '0xEb3907eCad74a0013c259D5874AE7f22DcBcC95C'} }; `; function setConfigs(configs, envFile) { fs.writeFile(`./src/environments/` + envFile, configs, function (err) { if (err) { throw console.error(err); } else { console.log(`Angular ${envFile} file generated`); } }); } setConfigs(devEnvironment, 'environment.ts'); setConfigs(prodEnvironment, 'environment.prod.ts');