Created
May 28, 2013 18:11
-
-
Save tseaver/5664821 to your computer and use it in GitHub Desktop.
Git pre-commit hook to generate / update distutils' MANIFEST.in file using 'git ls-files'.
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/sh | |
#============================================================================= | |
# Generate distutils' MANIFEST.in from the checked-in contents of a Git repo. | |
# | |
# Symlink this script into your Git clone as '.git/hooks/pre-commit' | |
# After that point, any commit will cause 'MANIFEST.in' to be generated in | |
# the root of the clone. The *second* commit will update the file to name | |
# itself (not a bug, just an oddity, as distutils includes MANIFEST.in if | |
# it is present, no matter what). | |
#============================================================================= | |
GIT=/usr/bin/git | |
cd `$GIT rev-parse --show-toplevel` | |
$GIT ls-files > MANIFEST.in | |
$GIT add MANIFEST.in |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment