We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8eb77fc commit 2e247b6Copy full SHA for 2e247b6
bin/git-cp
@@ -42,8 +42,8 @@ else
42
echo 1>&2 "$DESTINATION_FILENAME is not a file path."
43
exit 80
44
fi
45
- DESTINATION_DIR="${DESTINATION_FILENAME%/*}"
46
- if [ ! -d "$DESTINATION_DIR" ]; then
+ if [[ "$DESTINATION_FILENAME" = */* ]]; then
+ DESTINATION_DIR="${DESTINATION_FILENAME%/*}"
47
if ! mkdir -p "$DESTINATION_DIR"; then
48
echo 1>&2 "Failed to create destination directory: $DESTINATION_DIR"
49
exit 160
0 commit comments