File tree Expand file tree Collapse file tree 1 file changed +4
-11
lines changed
Expand file tree Collapse file tree 1 file changed +4
-11
lines changed Original file line number Diff line number Diff line change 2020# Ensure that we have the `cds` command
2121if ! command -v cds & > /dev/null
2222then
23- # Find all the directories containing a package.json with a dependency on @sap/cds, then install
24- # the cds development kit (@sap/cds-dk) in each directory, which makes the `cds` command usable
25- # from the npx command within that directory.
26- #
27- # Nested package.json files simply cause the package to be installed in the parent node_modules
28- # directory.
29- #
30- # We also ensure we skip node_modules, as we can end up in a recursive loop
31- find . -type d -name node_modules -prune -false -o -type f \( -iname ' package.json' \) -exec grep -l ' @sap/cds' {} + -execdir bash -c " echo \" Installing @sap/cds-dk into \$ (pwd) to enable CDS compilation.\" " \; -execdir npm install @sap/cds-dk \;
32- cds_command=" npx cds"
23+ # Use the npx command to dynamically install the cds development kit (@sap/cds-dk) package if necessary,
24+ # which then provides the cds command line tool.
25+ cds_command=" npx -y --package @sap/cds-dk cds"
3326else
3427 cds_command=" cds"
3528fi
6255export LGTM_INDEX_FILTERS=$' exclude:**/*.*\n include:**/*cds.json'
6356export LGTM_INDEX_TYPESCRIPT=" NONE"
6457# Configure to copy over the CDS files as well, by pretending they are JSON
65- export LGTM_INDEX_FILETYPES: " .cds:JSON"
58+ export LGTM_INDEX_FILETYPES= " .cds:JSON"
6659
6760echo " Extracting the cds.json files"
6861
You can’t perform that action at this time.
0 commit comments