mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Fix double legacy install on windows
This commit is contained in:
parent
b8300268bf
commit
af2c6de9ae
2 changed files with 12 additions and 1 deletions
|
|
@ -5,6 +5,7 @@ import io
|
|||
import itertools
|
||||
import logging
|
||||
import os.path
|
||||
import shutil
|
||||
import sys
|
||||
|
||||
from pre_commit import git
|
||||
|
|
@ -84,7 +85,7 @@ def install(
|
|||
|
||||
# If we have an existing hook, move it to pre-commit.legacy
|
||||
if os.path.lexists(hook_path) and not is_our_script(hook_path):
|
||||
os.rename(hook_path, legacy_path)
|
||||
shutil.move(hook_path, legacy_path)
|
||||
|
||||
# If we specify overwrite, we simply delete the legacy file
|
||||
if overwrite and os.path.exists(legacy_path):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue