Created
October 10, 2014 17:20
-
-
Save macroscopicentric/c25069735090e6138817 to your computer and use it in GitHub Desktop.
Boilerplate script for creating new project repos.
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
import sys | |
import subprocess | |
def make_boilerplate(directory): | |
#Don't split and add shell=True arg to subprocess to concatenate commands. | |
mkdir = 'mkdir {0}' | |
tests = 'mkdir {0}/tests && touch {0}/tests/__init__.py && touch {0}/__init__.py' | |
# virtualenv_config = 'mkvirtualenv {0} && pip install nose' | |
git_setup = 'git -C {0} init && echo "*.pyc" > {0}/.gitignore && git -C {0} add -A && git -C {0} commit -m "Boilerplate repo."' | |
commands = [mkdir, tests, git_setup] | |
for command in commands: | |
subprocess.call(command.format(directory), shell=True) | |
if __name__ == '__main__': | |
make_boilerplate(sys.argv[1]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment