Last active
February 22, 2019 17:39
-
-
Save orta/0f8171d5d41e1ff1b2b83afe98a44b79 to your computer and use it in GitHub Desktop.
Add flow to all your JS files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Based on http://stackoverflow.com/questions/151677/tool-for-adding-license-headers-to-source-files | |
for i in *.js | |
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
thx, works ok but I had an issue with the selection of all files so I used
for i in App/**/*.js