import os

src = '{{cookiecutter.repo_name}}/src/utils/prepare-commit-msg.py'
dst = '{{cookiecutter.repo_name}}/.git/hooks/prepare-commit-msg'

os.mkdir('{{cookiecutter.repo_name}}/.git/hooks')
os.symlink(src, dst)

import os
import subprocess

project_dir = '{{cookiecutter.repo_name}}'
hooks_dir = os.path.join(project_dir, '.git/hooks')

src = os.path.join(project_dir, 'src/utils/prepare-commit-msg.py')
dst = os.path.join(hooks_dir, 'prepare-commit-msg')

process = subprocess.Popen('git', 'init', project_dir)
process.wait()

os.mkdir('{{cookiecutter.repo_name}}/.git/hooks')
os.symlink(src, dst)

Add git init to post generate hook
Add git init to post generate hook

  import os
+ import subprocess
  
- src = '{{cookiecutter.repo_name}}/src/utils/prepare-commit-msg.py'
- dst = '{{cookiecutter.repo_name}}/.git/hooks/prepare-commit-msg'
+ project_dir = '{{cookiecutter.repo_name}}'
+ hooks_dir = os.path.join(project_dir, '.git/hooks')
+ 
+ src = os.path.join(project_dir, 'src/utils/prepare-commit-msg.py')
+ dst = os.path.join(hooks_dir, 'prepare-commit-msg')
+ 
+ process = subprocess.Popen('git', 'init', project_dir)
+ process.wait()
  
  os.mkdir('{{cookiecutter.repo_name}}/.git/hooks')
  os.symlink(src, dst)
  
Add git init to post generate hook
## Code Before:
import os

src = '{{cookiecutter.repo_name}}/src/utils/prepare-commit-msg.py'
dst = '{{cookiecutter.repo_name}}/.git/hooks/prepare-commit-msg'

os.mkdir('{{cookiecutter.repo_name}}/.git/hooks')
os.symlink(src, dst)

## Instruction:
Add git init to post generate hook
## Code After:
import os
import subprocess

project_dir = '{{cookiecutter.repo_name}}'
hooks_dir = os.path.join(project_dir, '.git/hooks')

src = os.path.join(project_dir, 'src/utils/prepare-commit-msg.py')
dst = os.path.join(hooks_dir, 'prepare-commit-msg')

process = subprocess.Popen('git', 'init', project_dir)
process.wait()

os.mkdir('{{cookiecutter.repo_name}}/.git/hooks')
os.symlink(src, dst)
