From 82dc5bedbcc2d33afde630e7604e0f1423ba0c35 Mon Sep 17 00:00:00 2001 From: Hadeed Ahmad Date: Tue, 22 Aug 2023 17:49:12 +0500 Subject: [PATCH] Fix stow.py not deleting broken symlinks --- bin/stow.py | 2 +- zsh/dot-zshenv | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/stow.py b/bin/stow.py index 9572fc1..3add8f5 100755 --- a/bin/stow.py +++ b/bin/stow.py @@ -22,7 +22,7 @@ def stow(pkg, stow_dir): source = os.path.join(root, file) target = os.path.join(symlink_dir, re.sub("^dot-", ".", file)) - if os.path.exists(target): + if os.path.isfile(target) or os.path.islink(target): os.remove(target) os.symlink(source, target) diff --git a/zsh/dot-zshenv b/zsh/dot-zshenv index f2133b9..bfd056e 100644 --- a/zsh/dot-zshenv +++ b/zsh/dot-zshenv @@ -1,7 +1,7 @@ typeset -U path path+="$HOME/bin" -export DOTS="$HOME/repos/dots" +export DOTS="$HOME/docs/repos/dots" export VISUAL="nvim" export EDITOR="nvim"