We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a04df70 commit 180c155Copy full SHA for 180c155
scripts/removeAnchors.sh
@@ -8,7 +8,14 @@ set -x
8
set -e
9
10
# All .purs & .js files in the src/ and test/ directories of chapter exercises.
11
-FILES=$(find . -regextype posix-extended -regex '\./exercises/chapter[0-9]{1,2}/(src|test)/.*\.(purs|js)' -type f)
+FIND_FILES_PATTERN='\./exercises/chapter[0-9]{1,2}/(src|test)/.*\.(purs|js)'
12
+
13
+EXTENDED_REGEX_FLAGS="-regextype posix-extended"
14
+# BSD find has different flags for extended regex
15
+if [[ $(uname) == 'FreeBSD' || $(uname) == 'Darwin' ]]; then
16
+ EXTENDED_REGEX_FLAGS='-E'
17
+fi
18
+FILES=$(find . -type f $EXTENDED_REGEX_FLAGS -regex $FIND_FILES_PATTERN)
19
20
for f in $FILES; do
21
# Delete lines starting with an 'ANCHOR' comment
0 commit comments