Skip to content

Instantly share code, notes, and snippets.

@peey
Last active May 14, 2017 07:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peey/ad360ae16e8ece0d6c5904acf278b4a0 to your computer and use it in GitHub Desktop.
Save peey/ad360ae16e8ece0d6c5904acf278b4a0 to your computer and use it in GitHub Desktop.
#!/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