Skip to content

Instantly share code, notes, and snippets.

@nemisj
Last active August 29, 2015 14:20
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 nemisj/bd5df196d264238a6fde to your computer and use it in GitHub Desktop.
Save nemisj/bd5df196d264238a6fde to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# this script will convert every file using babel
# in the lib folder which ends with es6.js
# and put it into the same folder using es5 prefix
# so lib/bla.es6.js will become lib/bla.es5.js
files=$(ls ./lib/*.es6.js);
for file in $files; do
new_file=$(echo $file | sed -e "s/es6/es5/")
./node_modules/.bin/babel $file > $new_file
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment