Skip to content

Instantly share code, notes, and snippets.

@peey peey/babel-see-fixtures
Last active May 14, 2017

Embed
What would you like to do?
#!/bin/bash
# usage instructions (on linux):
# 1. put the file in your path (e.g. "/usr/bin")
# 2. cd to packages/plugin-you-want-to-see-fixtures-of and run babel-see-fixtures
out=`mktemp --suffix=.js`
for D in `find test/fixtures -type d`
do
if [ -f "$D/actual.js" ]; then
echo -e "// $D\n" >> $out
fi
if [ -f "$D/options.json" ]; then
echo -e "// $D options" >> $out
cat "$D/options.json" >> $out
echo -e "\n" >> $out
fi
if [ -f "$D/actual.js" ]; then
echo -e "// actual" >> $out
cat "$D/actual.js" >> $out
echo -e "\n" >> $out
fi
if [ -f "$D/expected.js" ]; then
echo -e "// expected" >> $out
cat "$D/expected.js" >> $out
echo -e "\n" >> $out
fi
done
vi $out # replace with "subl $out", "gedit $out", etc. whichever editor you have installed/prefer
rm $out
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.