Skip to content

Commit 1c384b1

Browse files
committed
Improve logging and quoting in extractor scripts
Adds minimal logging statements to make it easier to debug which extractor script is running and/or producing an error. Adds double-quotes to string parameters used in extractor (bash) scripts in order to (hopefully) avoid problems related to shell escaping of glob patterns.
1 parent 3dc4f40 commit 1c384b1

File tree

3 files changed

+27
-17
lines changed

3 files changed

+27
-17
lines changed

extractors/cds/tools/autobuild.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
set -eu
44

55
exec "${CODEQL_DIST}/codeql" database index-files \
6-
--include-extension=.cds \
7-
--language cds \
8-
--prune **/node_modules/**/* \
9-
--prune **/.eslint/**/* \
10-
--total-size-limit=10m \
6+
--include-extension=".cds" \
7+
--language="cds" \
8+
--prune="**/node_modules/**/*" \
9+
--prune="**/.eslint/**/*" \
10+
--total-size-limit="10m" \
1111
-- \
1212
"$CODEQL_EXTRACTOR_CDS_WIP_DATABASE"

extractors/cds/tools/index-files.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,3 +365,5 @@ spawnSync(
365365
[],
366366
{ cwd: sourceRoot, env: process.env, shell: true, stdio: 'inherit' }
367367
);
368+
369+
console.log(`Completed run of index-files.js script for CDS extractor.`);

extractors/javascript/tools/pre-finalize.sh

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,35 @@ set -eu
55
# Do not extract CDS files if the CODEQL_EXTRACTOR_CDS_SKIP_EXTRACTION
66
# environment variable is set.
77
if [ -z "${CODEQL_EXTRACTOR_CDS_SKIP_EXTRACTION:-}" ]; then
8-
# Call the index-files command with the CDS extractor
8+
echo "Running database index-files for CDS (.cds) files ..."
9+
10+
# Call the index-files command with the CDS extractor.
911
"${CODEQL_DIST}/codeql" database index-files \
10-
--include-extension=.cds \
11-
--language cds \
12-
--prune **/node_modules/**/* \
13-
--prune **/.eslint/**/* \
14-
--total-size-limit=10m \
12+
--include-extension=".cds" \
13+
--language="cds" \
14+
--prune="**/node_modules/**/*" \
15+
--prune="**/.eslint/**/*" \
16+
--total-size-limit="10m" \
1517
-- \
1618
"$CODEQL_EXTRACTOR_JAVASCRIPT_WIP_DATABASE"
19+
20+
echo "Finished running database index-files for CDS (.cds) files."
1721
fi
1822

19-
# Index UI5 *.view.xml files
23+
echo "Running database index-files for UI5 (.view.xml) files ..."
24+
25+
# Index UI5 *.view.xml files.
2026
"${CODEQL_DIST}/codeql" database index-files \
21-
--include-extension=.view.xml \
22-
--language xml \
23-
--prune **/node_modules/**/* \
24-
--prune **/.eslint/**/* \
25-
--total-size-limit=10m \
27+
--include-extension=".view.xml" \
28+
--language="xml" \
29+
--prune="**/node_modules/**/*" \
30+
--prune="**/.eslint/**/*" \
31+
--total-size-limit="10m" \
2632
-- \
2733
"$CODEQL_EXTRACTOR_JAVASCRIPT_WIP_DATABASE"
2834

35+
echo "Finished running database index-files for UI5 (.view.xml) files."
36+
2937
# UI5 also requires *.view.json files and *.view.html files be indexed, but these are indexed by
3038
# default by CodeQL.
3139

0 commit comments

Comments
 (0)