trufflehog/scripts/test_changed_detectors.sh
Dustin Decker 86c2eb507b Adding detectors (#46)
* rename secret

* Add supporting docs and tooling for adding new detectors
2022-03-04 08:39:22 -08:00

17 lines
464 B
Bash
Executable file

#!/bin/bash
set -uo pipefail
CHANGED=$(git diff --name-only --no-commit-id origin/master | grep pkg/detectors | grep -v test)
while IFS= read -r FILE; do
DIRECTORY=$(basename $FILE ".go")
if [ -d "pkg/detectors/$DIRECTORY" ]
then
echo $DIRECTORY
go test -v "github.com/trufflesecurity/trufflehog/v3/pkg/detectors/$DIRECTORY"
retVal=$?
if [ $retVal -ne 0 ]; then
exit 1
fi
fi
done <<< "$CHANGED"