Created
January 23, 2019 04:29
-
-
Save jsakas/d0251185b16be5b4df45084855c61c39 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Convert a directory of coffeescript test files to commonjs / jest | |
# and move them over to the src directory. | |
# | |
for coffee_file in $(find tests -name "*.coffee" -type f) | |
do | |
js_file=$coffee_file | |
js_file=$(echo "$js_file" | sed 's/Tests.coffee/.test.js/') | |
js_file=$(echo "$js_file" | sed 's/Tests.coffee/.test.js/') | |
js_file=$(echo "$js_file" | sed 's/.coffee/.test.js/') | |
js_file=$(echo "$js_file" | sed 's/tests/src/') | |
echo "${coffee_file} -> ${js_file}" | |
git mv $coffee_file $js_file | |
coffee -b -c $js_file | |
babel $js_file -o $js_file --plugins=babel-plugin-transform-amd-to-commonjs | |
done | |
jest-codemods src/musicstore --force |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment