From 937b0b01eb86214b28901cf621d3bcbdc0980fa7 Mon Sep 17 00:00:00 2001 From: gpkvt Date: Fri, 14 Jul 2023 22:56:46 +0200 Subject: [PATCH] Check if symlink already exists to avoid sudo asking for passwords --- neofetch/deploy.zsh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/neofetch/deploy.zsh b/neofetch/deploy.zsh index 2b8fddf..7fcf6e8 100755 --- a/neofetch/deploy.zsh +++ b/neofetch/deploy.zsh @@ -2,5 +2,9 @@ GIT_ROOT=$(git rev-parse --show-toplevel) -sudo rm /etc/neofetch.conf -sudo ln -s ${GIT_ROOT}/neofetch/neofetch.conf /etc/neofetch.conf +if [[ -L "/etc/neofetch.conf" ]]; then + echo "Symlink for neofetch already exists, skipping" +else + echo "Creating symlink for neofetch.conf" + sudo ln -s ${GIT_ROOT}/neofetch/neofetch.conf /etc/neofetch.conf +fi \ No newline at end of file