Skip to content

Instantly share code, notes, and snippets.

@orta
Last active February 22, 2019 17:39
Show Gist options
  • Save orta/0f8171d5d41e1ff1b2b83afe98a44b79 to your computer and use it in GitHub Desktop.
Save orta/0f8171d5d41e1ff1b2b83afe98a44b79 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
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
@dkocich
Copy link

dkocich commented Feb 22, 2019

thx, works ok but I had an issue with the selection of all files so I used for i in App/**/*.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment