Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
targetFile = configLocations.getSourceFile(options.org, options.env);
const cache = configLocations.getCachePath(options.org, options.env);
if (fs.existsSync(cache)) {
fs.unlinkSync(cache);
//writeConsoleLog('log',{component: CONSOLE_LOG_TAG_COMP}, 'deleted ' + cache);
}
const targetPath = configLocations.getSourcePath(options.org, options.env);
if (fs.existsSync(targetPath)) {
fs.unlinkSync(targetPath);
//writeConsoleLog('log',{component: CONSOLE_LOG_TAG_COMP}, 'deleted ' + targetPath);
}
var configFileDirectory = options.configDir || configLocations.homeDir;
//writeConsoleLog('log',{component: CONSOLE_LOG_TAG_COMP}, 'init config');
edgeconfig.init({
source: configLocations.getDefaultPath(options.configDir),
targetDir: configFileDirectory,
targetFile: targetFile,
overwrite: true
}, function (/* err, configPath */) {
options.deployed = false;
deployAuth.checkDeployedProxies(options, (err, options) => {
if (err) {
writeConsoleLog('error',{component: CONSOLE_LOG_TAG_COMP}, err);
if ( cb ) { cb(err) } else process.exit(1);
return;
}
configureEdgemicroWithCreds(options, (err) => {
if (err) {
writeConsoleLog('error',{component: CONSOLE_LOG_TAG_COMP}, err);
if ( cb ) { cb(err) } else process.exit(1);