Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
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"