Skip to content

Instantly share code, notes, and snippets.

@djoeman84
Forked from orta/add_flow.sh
Last active August 2, 2017 06:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save djoeman84/a5abfe6f763604697425155b29e6ba46 to your computer and use it in GitHub Desktop.
Save djoeman84/a5abfe6f763604697425155b29e6ba46 to your computer and use it in GitHub Desktop.
Add flow to all your JS files
#!/bin/bash
# Based on http://stackoverflow.com/questions/151677/tool-for-adding-license-headers-to-source-files
find . -type f -iname "*.js" -print0 | while IFS= read -r -d $'\0' i;
do
if ! grep -q @flow $i
then
(echo "" & echo "/* @flow */") > flowificator
cat flowificator $i >$i.new && mv $i.new $i
rm flowificator
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment