Last active
September 7, 2016 18:20
-
-
Save timmc/7359898 to your computer and use it in GitHub Desktop.
debug-compilation.sh: Emit progress to stdout as your Clojure compiles.
This file contains 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 | |
# Munge your codebase to add :verbose on all :require and :use forms and insert printlns in front of defns. | |
# $1: Path to directory you want to munge files in (recursively). | |
# WARNING: There is not an easy way to reverse this script, so commit your work beforehand | |
# and undo the munging with `git reset --hard HEAD` or similar. | |
find "$1" -name '*.clj' -exec sed -i 's/\((defn\? \([a-z0-9<>_*+-]\+\)\)/(println "var \2")\n\1/' '{}' \; | |
find "$1" -name '*.clj' -exec sed -i 's/:\(require\|use\) /:\1 :verbose /' '{}' \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment