From f5dd5142f69e3f9a3a9e0095b70333d4af4df31c Mon Sep 17 00:00:00 2001 From: Daylin Morgan Date: Mon, 29 May 2023 11:12:07 -0500 Subject: [PATCH] fix: don't overwrite src without permission --- src/viv/viv.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/viv/viv.py b/src/viv/viv.py index 1361969..420a1d6 100755 --- a/src/viv/viv.py +++ b/src/viv/viv.py @@ -52,7 +52,7 @@ from typing import ( from urllib.error import HTTPError from urllib.request import urlopen -__version__ = "23.5a2-6-gd3f4bf9-dev" +__version__ = "23.5a2-7-g0aff002-dev" class Config: @@ -1048,10 +1048,12 @@ class Viv: make_executable(src) echo("symlinking cli") - if not cli.is_file(): + if cli.is_file() and confirm( + f"Existing file at {cli}, would you like to overwrite it?" + ): + cli.unlink(src) cli.symlink_to(src) else: - cli.unlink() cli.symlink_to(src) echo("Remember to include the following line in your shell rc file:")