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
echo node executable is required (in PATH) to run the 'index-files.js' script. Please install Node.js and try again.
11
+
exit /b 2
12
+
)
13
+
14
+
where npm >nul2>nul
15
+
if%ERRORLEVEL%neq0 (
16
+
echo npm executable is required (in PATH) to install the dependencies for the 'index-files.js' script.
17
+
exit /b 3
18
+
)
19
+
20
+
set"_response_file_path=%~1"
21
+
set"_script_dir=%~dp0"
22
+
REM Set _cwd before changing the working directory to the script directory.
23
+
set"_cwd=%CD%"
24
+
25
+
echo Checking response file for CDS files to index
26
+
27
+
REM Terminate early if the _response_file_path doesn't exist or is empty,
28
+
REM which indicates that no CDS files were selected or found.
29
+
ifnotexist"%_response_file_path%" (
30
+
echo 'codeql database index-files --language cds' command terminated early as response file '%_response_file_path%' does not exist or is empty. This is because no CDS files were selected or found.
31
+
exit /b 0
32
+
)
33
+
34
+
REM Change to the directory of this script to ensure that npm looks up the
35
+
REM package.json file in the correct directory and installs the dependencies
36
+
REM (i.e. node_modules) relative to this directory. This is technically a
37
+
REM violation of the assumption that extractor scripts will be run with the
38
+
REM current working directory set to the root of the project source, but we
39
+
REM also need node_modules to be installed here and not in the project source
40
+
REM root, so we make a compromise of:
41
+
REM 1. changing to this script's directory;
42
+
REM 2. installing node dependencies here;
43
+
REM 3. passing the original working directory as a parameter to the
44
+
REM index-files.js script;
45
+
REM 4. expecting the index-files.js script to immediately change back to
46
+
REM the original working (aka the project source root) directory.
0 commit comments