Skip to content

Commit

Permalink
Make scripts portable
Browse files Browse the repository at this point in the history
`which -s` works on MacOS but not Ubuntu
  • Loading branch information
simpsonjulian committed Oct 9, 2024
1 parent c568175 commit 50ecae2
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion acceptance.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ brew install semgrep \

pip install sarif-tools

./statica WebGoat html
./statica WebGoat html
2 changes: 1 addition & 1 deletion tools.d/bearer
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

set -euo pipefail
which -s bearer || exit 1
which bearer > /dev/null || exit 1
source=$1

tmpdir=$(mktemp -d)
Expand Down
2 changes: 1 addition & 1 deletion tools.d/checkov
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

set -euo pipefail
which -s checkov || exit 1
which checkov > /dev/null || exit 1

source=$1

Expand Down
3 changes: 1 addition & 2 deletions tools.d/churn
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/bin/bash

#set -euo pipefail
which -s git || exit 1
which git > /dev/null || exit 1

source=$1
tmpdir=$(mktemp -d)
Expand Down
2 changes: 1 addition & 1 deletion tools.d/depcheck
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

set -euo pipefail
which -s dependency-check || exit 1
which dependency-check > /dev/null || exit 1

source=$1

Expand Down
2 changes: 1 addition & 1 deletion tools.d/jscpd
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

set -euo pipefail
which -s jscpd || exit 1
which jscpd > /dev/null || exit 1
npm ls -g | grep -q jscpd-sarif-reporter || exit 1

MIN_LINES=15
Expand Down
2 changes: 1 addition & 1 deletion tools.d/lizard
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

set -euo pipefail
which -s lizard || exit 1
which lizard > /dev/null || exit 1

source=$1
tmpdir=$(mktemp -d)
Expand Down
2 changes: 1 addition & 1 deletion tools.d/semgrep
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

set -euo pipefail
which -s semgrep || exit 1
which semgrep > /dev/null || exit 1

source=$1
semgrep scan "${source}" --sarif
2 changes: 1 addition & 1 deletion tools.d/trivy
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

set -euo pipefail
which -s trivy || exit 1
which trivy > /dev/null || exit 1

source=$1
trivy -q --format sarif fs "${source}"

0 comments on commit 50ecae2

Please sign in to comment.