Skip to content

Instantly share code, notes, and snippets.

@PsychoLlama
Created January 24, 2018 22:36
Show Gist options
  • Save PsychoLlama/3e367cc25134dca8a781a40eab987060 to your computer and use it in GitHub Desktop.
Save PsychoLlama/3e367cc25134dca8a781a40eab987060 to your computer and use it in GitHub Desktop.
Export flow type definitions (just bash)
#!/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