Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
Commitf7971217b53e9375ac9e3517527b9b77a6f2f3d6 (patch)
Author
 Syndamia <kamen@syndamia.com>
2023-10-23 14:54:04 +0300
Committer
 Syndamia <kamen@syndamia.com>
2023-10-23 14:54:04 +0300
Filesb97a8811376b8c62507edbe0135d6ddd8a084368
csg-f7971217b53e9375ac9e3517527b9b77a6f2f3d6.tar
csg-f7971217b53e9375ac9e3517527b9b77a6f2f3d6.tar.gz
csg-f7971217b53e9375ac9e3517527b9b77a6f2f3d6.zip
Parent1f6cf0254bfbb3c954da84f616c08a09a66932be (diff)
[p2] Fixed parent folder logic when DESTINATION doesn't exist
1 files changed, 2 insertions, 2 deletions
-rwxr-xr-xcsg4
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 (<destination_dir>) isn't a directory or doesn't exist!" \
+[ ! -d "${DESTINATION%/*}" ] && echo "[Error] Parent directory of $2 (<destination_dir>) isn't a directory or doesn't exist!" \
&& csg_help 1
-[ ! -w "$DESTINATION/.." ] && echo "[Error] No write access to parent directory of $2 (<destination_dir>)!" \
+[ ! -w "${DESTINATION%/*}" ] && echo "[Error] No write access to parent directory of $2 (<destination_dir>)!" \
&& csg_help 2
TITLEF="$3"