def initialize_git(self, dirpath): """Initialize project folder as new repo, if git installed.""" try: check_git() except ShellFailed: return # we have git, lets make a repo shell('git init', msg='Initializing project as git repo', cwd=dirpath) fname = os.path.join(dirpath, '.gitignore') with open(fname, 'w') as f: f.write(GITIGNORE) shell('git add .', msg=None, cwd=dirpath) shell('git commit -a -m "Initial commit."', msg='Creating initial git commit', cwd=dirpath)
def initialize_git(self, dirpath): """If git installed, initialize project folder as new repo. """ try: check_git() except ShellFailed: return False # we have git, lets make a repo shell('git init', msg='Initializing project as git repo', cwd=dirpath) shell('git add .', msg=None, cwd=dirpath) shell('git commit -a -m "Initial commit."', msg='Creating initial git commit', cwd=dirpath) shell('git tag -a 0.0.1 -m 0.0.1', msg='Tagging as release 0.0.1', cwd=dirpath) return True