You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds comments in index-files.js to better reflect the documented
intentions from the old version of index-files.sh script. Better
explains the script magic, in places.
Attempts to make the index-files.js (JavaScript) script more useful
as a multi-platform solution by normalizing file paths using the
path.join() function.
// If the response file does not exist, terminate.
11
19
if(!existsSync(responseFile)){
12
20
console.log(`'codeql database index-files --language cds' terminated early as response file '${responseFile}' does not exist. This is because no CDS files were selected or found.`);
console.log(`'codeql database index-files --language cds' terminated early as response file '${responseFile}' is empty. This is because no CDS files were selected or found.`);
18
28
process.exit(0);
19
29
}
20
30
31
+
// Determine if we have the cds commands available. If not, install the cds develpment kit
32
+
// (cds-dk) in the appropriate directories and use npx to run the cds command from there.
consterrorMessage=`Could not compile the file ${cdsFile}.\nReported error(s):\n\`\`\`\n${stderrTruncated}\n\`\`\``;
59
93
console.log(errorMessage);
60
-
execSync(`${process.env.CODEQL_DIST}/codeql database add-diagnostic --extractor-name cds --ready-for-status-page --source-idcds/compilation-failure --source-name"Failure to compile one or more SAP CAP CDS files" --severityerror --markdown-message"${errorMessage}" --file-path"${cdsFile}" "${process.env.CODEQL_EXTRACTOR_CDS_WIP_DATABASE}"`);
94
+
execSync(`${codeqlExePath} database add-diagnostic --extractor-name cds --ready-for-status-page --source-id=cds/compilation-failure --source-name="Failure to compile one or more SAP CAP CDS files" --severity=error --markdown-message="${errorMessage}" --file-path="${cdsFile}" -- "${process.env.CODEQL_EXTRACTOR_CDS_WIP_DATABASE}"`);
61
95
}
62
96
});
63
97
98
+
// Check if the (JavaScript) JS extractor variables are set, and set them if not.
0 commit comments