Skip to content

Instantly share code, notes, and snippets.

@clonn
Last active August 29, 2015 14:12
Show Gist options
  • Select an option

  • Save clonn/dc9d523910d82fef5e64 to your computer and use it in GitHub Desktop.

Select an option

Save clonn/dc9d523910d82fef5e64 to your computer and use it in GitHub Desktop.
bath to converting whole project to CoffeeScript with js2coffee
#!/bin/bash
for FILE in `find . -name "*.js" -type f -o -path './node_modules' -prune -o -path './components' -prune`
do
if [ -e $FILE ] ; then
COFFEE=${FILE//.js/.coffee}
echo "converting ${FILE} to ${COFFEE}"
js2coffee "$FILE" > "$COFFEE"
else
echo "File: {$1} does not exist!"
fi
done
#remove .js file
# rm ./**/*.js
# http://stackoverflow.com/questions/14091818/converting-whole-project-to-coffeescript-with-js2coffee
@clonn

clonn commented Dec 29, 2014

Copy link
Copy Markdown
Author

Ref, js2coffee

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment