From f54c1d8649f746cd7f2197589c7927199c725adb Mon Sep 17 00:00:00 2001 From: Peder Bergebakken Sundt Date: Fri, 21 Feb 2025 21:51:59 +0100 Subject: [PATCH] fix destore --- users/pbsds/home/profiles/bashrc.d/destore.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/users/pbsds/home/profiles/bashrc.d/destore.sh b/users/pbsds/home/profiles/bashrc.d/destore.sh index 0404e3a..f1a437a 100644 --- a/users/pbsds/home/profiles/bashrc.d/destore.sh +++ b/users/pbsds/home/profiles/bashrc.d/destore.sh @@ -1,8 +1,7 @@ destore() { for dst in "$@"; do local MAYBESUDO="" - if test ! -w "$(realpath --no-symlinks $dst)" \ - || test ! -w "$(basename "$(realpath --no-symlinks $dst)")"; then + if test ! -w "$(dirname $(realpath --no-symlinks $dst))" ; then MAYBESUDO="sudo" sudo true || { >&2 echo "ERROR: could not destore '$dst' due to lack of sudo"