Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public executeTask(gulp: gulp.Gulp, completeCallback?: (result?: Object) => void): void {
let outputPath: string = path.join(this.buildConfig.rootPath, this.buildConfig.distFolder);
if (!fs.existsSync(outputPath)) {
fs.mkdirSync(outputPath);
}
outputPath = path.join(outputPath, 'external-api-json');
if (!fs.existsSync(outputPath)) {
fs.mkdirSync(outputPath);
}
for (const filePath of files) {
const rootDir: string = path.dirname(filePath);
const outputApiJsonFilePath: string = path.join(outputPath, `${path.basename(rootDir)}.api.json`);
const entryPointFile: string = path.join(this.buildConfig.rootPath, filePath);
ExternalApiHelper.generateApiJson(this.buildConfig.rootPath, entryPointFile, outputApiJsonFilePath);
}
completeCallback();
}
}