Created
January 24, 2018 22:36
-
-
Save PsychoLlama/3e367cc25134dca8a781a40eab987060 to your computer and use it in GitHub Desktop.
Export flow type definitions (just bash)
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
#!/usr/bin/env bash | |
set -e | |
# Assumes source files are in the src/ directory | |
find src -type f | while read filename; do | |
# Ignore these directories (like __tests__ or __stories__) | |
if [[ "$filename" =~ __[a-zA-Z]+__ ]]; then | |
continue | |
fi | |
# Append .flow to the name and redirect to dist/ | |
FLOW_NAME="$(sed 's/src/dist/; s/.*/&.flow/' <<< "$filename")" | |
cp "$filename" "$FLOW_NAME" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment