Skip to content

Instantly share code, notes, and snippets.

@dhermes
Created November 11, 2014 06:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dhermes/877ed7c9838d6fc5bb08 to your computer and use it in GitHub Desktop.
Save dhermes/877ed7c9838d6fc5bb08 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import os
hooks_dir = os.path.dirname(os.path.abspath(__file__))
relative_dir = os.path.join(hooks_dir, '../..')
project_root = os.path.abspath(relative_dir)
git_included_config = os.path.join(project_root, 'config.js')
confidential_config = os.path.join(project_root, '_config.js')
with open(git_included_config, 'rU') as fh:
git_included_contents = fh.read()
with open(confidential_config, 'rU') as fh:
confidential_contents = fh.read()
with open(git_included_config, 'w') as fh:
fh.write(confidential_contents)
with open(confidential_config, 'w') as fh:
fh.write(git_included_contents)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment