Skip to content

Commit

Permalink
Combine grep flags
Browse files Browse the repository at this point in the history
  • Loading branch information
bangbay-bluetiger committed Jan 22, 2025
1 parent 466207f commit e773c2e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions scripts/track-flags.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
LD_LOG_FILE=launchdarkly-flags.log
echo "# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.\n" > $LD_LOG_FILE
GREP_FLAGS="-r -n -o -w --exclude-dir=coverage --exclude-dir=node_modules --exclude-dir='.*'"
echo "# LaunchDarkly flags in components" >> $LD_LOG_FILE
(grep -r -n -o -w "useFlags().*" ./services --include=*.jsx --exclude=*.test.jsx --exclude-dir=coverage || echo "# None used") >> $LD_LOG_FILE
(grep $GREP_FLAGS "useFlags().*" ./services --include=*.jsx --exclude=*.test.jsx || echo "# None used") >> $LD_LOG_FILE
echo "" >> $LD_LOG_FILE
echo "# LaunchDarkly flags in tests" >> $LD_LOG_FILE
(grep -r -n -o -w "mockLDFlags.set.*" ./services --include=*.test.jsx --exclude-dir=coverage || echo "# None used") >> $LD_LOG_FILE
(grep $GREP_FLAGS "mockLDFlags.set.*" ./services --include=*.test.jsx || echo "# None used") >> $LD_LOG_FILE

0 comments on commit e773c2e

Please sign in to comment.