audreyr/cookiecutter — pull request #77 by fakedrake (2013-09-19 01:17:40+00:00)
Title: Can now access cookiecutter configuration with cookiecutter eval script

From any hook script you can run `cookiecuttereval -e VAR` and that will print in stdout the value of the variable. To do this I save the final configuration to an temporary file named `repo_name-cookiecutter.json` while cookiecutter is running. Then that script looks at `COOKIECUTTER_CONTEXT_FILE` for the path to that file and reads the configuration from there. This variable is configured correctly for each hook script being run so you can run the command without worrying about anything else from within any hook.

I tested this as well as I could but there are different scripts cooperating so I have definitely missed some edge cases.