From f7971217b53e9375ac9e3517527b9b77a6f2f3d6 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Mon, 23 Oct 2023 14:54:04 +0300 Subject: [p2] Fixed parent folder logic when DESTINATION doesn't exist --- csg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/csg b/csg index bde30dc..bcb007c 100755 --- a/csg +++ b/csg @@ -55,9 +55,9 @@ SOURCE="$1" && csg_help 2 DESTINATION="$(realpath "$2")" -[ ! -d "$DESTINATION/.." ] && echo "[Error] Parent directory of $2 () isn't a directory or doesn't exist!" \ +[ ! -d "${DESTINATION%/*}" ] && echo "[Error] Parent directory of $2 () isn't a directory or doesn't exist!" \ && csg_help 1 -[ ! -w "$DESTINATION/.." ] && echo "[Error] No write access to parent directory of $2 ()!" \ +[ ! -w "${DESTINATION%/*}" ] && echo "[Error] No write access to parent directory of $2 ()!" \ && csg_help 2 TITLEF="$3" -- cgit v1.3.1-26-gb76a