Skip to content

Commit 7d8553a

Browse files
committed
Fix GNU grep compatibility.
This commit resolves an issue with a GNU grep command using the -P flag. As a result, users without GNU Grep could not use the Perl Regular Expressions flag. This command has been removed and replaced with pcregrep which yields the same results and also allows forward look-aheads. Additionally, the test-files have been added to the .ccignore file so cloning the repository does not cause users to have the test-files in their first commit message. Closes Issue #1
1 parent a916600 commit 7d8553a

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

.ccignore

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
README.md
2-
prepapre-commit-msg
2+
prepare-commit-msg
33
post-commit
4-
.sh
4+
test.sh
5+
test-files/basic.cpp
6+
testfiles/thing.js
57
LICENSE

post-commit

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ IGNORED=( ".ccignore" )
1212
# can be found
1313
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
1414
if echo "$DIR" | grep -qs 'git'; then
15-
cd "$( echo "$DIR" | grep -Po '^.*(?=(\.git))' )"
15+
cd "$( echo "$DIR" | pcregrep -o '^.*(?=(\.git))' )"
1616
fi
1717

1818
if [ -f ".ccignore" ]; then
19-
while IFS='' read -r line || [[ -n "$line" ]]; do
20-
IGNORED+=( "$line" )
19+
while IFS='' read -r line || [[ -n "$line" ]]; do
20+
IGNORED+=( "$line" )
2121
done < ".ccignore"
2222
fi
2323

0 commit comments

Comments
 (0)