Skip to content

Instantly share code, notes, and snippets.

@tabrindle
Created April 26, 2016 20:33
Show Gist options
  • Save tabrindle/9affae679e8097737bc3e82ba7db1001 to your computer and use it in GitHub Desktop.
Save tabrindle/9affae679e8097737bc3e82ba7db1001 to your computer and use it in GitHub Desktop.
transpile sencha with babel
#!/bin/bash
project=$(pwd)
OLD_MD5=`cat $project/sencha/.app-es6.md5`
CURRENT_MD5=`tree -Ds -P '*.js' --timefmt %T $project/sencha/app-es6 | md5`
if [ "$OLD_MD5" != "$CURRENT_MD5" ]; then
tree -Ds -P '*.js' --timefmt %T $project/sencha/app-es6 | md5 > $project/sencha/.app-es6.md5
npm run build-prod
if [ $? -ne 0 ]; then
echo "Babel preprocessor failed" | ts '%T'
exit 1
else
echo "Babel preprocessor successful" | ts '%T'
fi
else
echo "Checksums match: Skipping Babel transpile" | ts '%T'
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment