Skip to content

Commit 261506d

Browse files
author
Zhe Yu
committed
feat(cli): Log warning if hook path is a symlink
1 parent 77078a5 commit 261506d

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/vectorcode/subcommands/init.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ def inject_hook(self, content: list[str], force: bool = False):
9292
self.lines.extend(i if i.endswith("\n") else i + "\n" for i in content)
9393
self.lines.append(self.suffix + "\n")
9494
with open(self.path, "w") as fin:
95+
if os.path.islink(self.path):
96+
logger.warning(f"{self.path} is a symlink.")
9597
fin.writelines(self.lines)
9698
if platform.system() != "Windows":
9799
# for unix systems, set the executable bit.

0 commit comments

Comments
 (0)