Skip to content

Instantly share code, notes, and snippets.

@orta
Last active Feb 22, 2019
Embed
What would you like to do?
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

This comment has been minimized.

Copy link

@dkocich 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