if not os.path.isfile(".git/hooks/pre_commit"):
if "windows" in platform.platform().lower():
import ctypes
kdll = ctypes.windll.LoadLibrary("kernel32.dll")
kdll.CreateSymbolicLinkA(os.path.realpath("hooks/pre_commit"), os.path.realpath(".git/hooks/pre_commit"), 0)
else:
from sh import ln
ln("-s", os.path.realpath("hooks/pre_commit"), os.path.realpath(".git/hooks/pre_commit"))