Skip to content

Commit 6f4a936

Browse files
committed
chore: updated pre-commit hook to only consider tracked files
1 parent 4e34e38 commit 6f4a936

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/dev_scripts/samples_permissions_checker.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ MACARON_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && cd ../.. && pwd)"
1212
SAMPLES_PATH="${MACARON_DIR}/tests/malware_analyzer/pypi/resources/sourcecode_samples"
1313

1414
# any files have any of the executable bits set
15-
executables=$(find "$SAMPLES_PATH" -type f -perm -u+x -o -type f -perm -g+x -o -type f -perm -o+x)
15+
executables=$( ( find "$SAMPLES_PATH" -type f -perm -u+x -o -type f -perm -g+x -o -type f -perm -o+x | sed "s|$MACARON_DIR/||"; git ls-files "$SAMPLES_PATH" --full-name) | sort | uniq -d)
1616
if [ -n "$executables" ]; then
1717
echo "The following files should not have any executable permissions:"
1818
echo "$executables"

0 commit comments

Comments
 (0)