Skip to content

Commit 241af8c

Browse files
committed
Run 'cds compile' command without '-o'
Updates unit-test and cds-extractor use of the `cds compile` command in order to avoid the use of the `-o` option, which outputs to a directory instead of a file, as intended. Replaces use of the `-o` option with a simple redirect of cds compiler output to stdout, which is redirected to the indended '.cds.json' file path. This commit should resolve failures for both code scanning and unit test workflows for this project/repo.
1 parent 0c8168e commit 241af8c

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

.github/workflows/run-codeql-unit-tests-javascript.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ jobs:
8181
run: |
8282
if ! command -v cds &> /dev/null
8383
then
84+
## Workaround for https://github.tools.sap/cap/issues/issues/17840
8485
npm install -g @sap/[email protected]
8586
fi
8687
@@ -97,8 +98,8 @@ jobs:
9798
echo "I am compiling $cds_file"
9899
cds compile $cds_file \
99100
-2 json \
100-
-o "$cds_file.json" \
101-
--locations
101+
--locations \
102+
> "$cds_file.json" 2> "$cds_file.err"
102103
done
103104
popd
104105
done

extractors/cds/tools/index-files.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ echo "Processing CDS files to JSON"
5252
# the same name
5353
while IFS= read -r cds_file; do
5454
echo "Processing CDS file $cds_file to:"
55-
if ! $cds_command compile "$cds_file" -2 json -o "$cds_file.json" --locations 2> "$cds_file.err"; then
55+
if ! $cds_command compile "$cds_file" -2 json --locations > "$cds_file.json" 2> "$cds_file.err"; then
5656
stderr_truncated=`grep "^\[ERROR\]" "$cds_file.err" | tail -n 4`
5757
error_message=$'Could not compile the file '"$cds_file"$'.\nReported error(s):\n```\n'"$stderr_truncated"$'\n```'
5858
echo "$error_message"

0 commit comments

Comments
 (0)