Skip to content

Instantly share code, notes, and snippets.

@Rigellute
Created May 26, 2018 11:45
Show Gist options
  • Save Rigellute/81aca3beafa64bf2b478e835e0dddb3d to your computer and use it in GitHub Desktop.
Save Rigellute/81aca3beafa64bf2b478e835e0dddb3d to your computer and use it in GitHub Desktop.
Add flow annotation to all files in src directory
#!/bin/bash
# Based on http://stackoverflow.com/questions/151677/tool-for-adding-license-headers-to-source-files
for i in $(find -L src -type f -name '*.js')
do
if ! grep -q @flow $i
then
(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