diff --git a/compiler/src/userIntents_parser/parseUserIntents.ts b/compiler/src/userIntents_parser/parseUserIntents.ts index b98525db19f0c73f9fe160f765661af2c512b5b0..35230d25b63b9520b5d544c3872a77432039a850 100644 --- a/compiler/src/userIntents_parser/parseUserIntents.ts +++ b/compiler/src/userIntents_parser/parseUserIntents.ts @@ -1551,11 +1551,18 @@ class ParseIntent { } public writeUserIntentJsonFile(): void { + if (!projectConfig.aceProfilePath) { + return; + } + const cachePath: string = + path.join(projectConfig.cachePath, 'insight_compile_cache.json'); // Compiled cache file + if (!(fs.existsSync(cachePath) || this.intentData.length > 0)) { + return; + } this.verifyInheritanceChain(); const writeJsonData: object = this.processIntentData(); const cacheSourceMapPath: string = path.join(projectConfig.aceProfilePath, 'insight_intent.json'); // The user's intents configuration file - const cachePath: string = path.join(projectConfig.cachePath, 'insight_compile_cache.json'); // Compiled cache file try { if (this.intentData.length > 0) { fs.writeFileSync(cacheSourceMapPath, JSON.stringify(writeJsonData, null, 2), 'utf-8');