Skip to content

Commit 95f9ed9

Browse files
committed
Don't reply on relative path to find tools
1 parent 3d2b6dc commit 95f9ed9

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

statica

+11-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ usage() {
88
}
99

1010
run_command() {
11-
PATH="${app_dir}:${brew_prefix}/bin:${brew_prefix}/opt/statica/libexec/tools.d:$PATH" "$@"
11+
local bin="${brew_prefix}/bin"
12+
local libexec="${brew_prefix}/opt/statica/libexec:${PATH}"
13+
PATH="${app_dir}:${bin}:${libexec}"
1214
}
1315

1416
if [ $# -lt 2 ]; then
@@ -34,8 +36,15 @@ done
3436

3537

3638
modes="$@"
39+
40+
if [ -d "${source}/tools.d" ]; then
41+
tools_dir="${source}/tools.d"
42+
else
43+
tools_dir="${brew_prefix}/opt/statica/libexec/tools.d"
44+
fi
45+
3746
echo "Scanning ${source}"
38-
for scanner in tools.d/*; do
47+
for scanner in ${tools_dir}/*; do
3948
name=$(basename "${scanner}")
4049
report="${tmpdir}/${name}.sarif"
4150
echo "Running ${name} and reporting to ${report}"

0 commit comments

Comments
 (0)