fix(files): Deleting .gitkeep file when path is ending in / pt.2 (#285)

This commit is contained in:
fiftydinar 2024-07-21 16:09:05 +02:00 committed by GitHub
commit 3b30283a6a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -37,7 +37,7 @@ if [[ ${#FILES[@]} -gt 0 ]]; then
fi
echo "Copying $FILE to $DEST"
cp -rf "$FILE"/* $DEST
if [[ "${DEST}" =~ */ ]]; then
if [[ "${DEST}" =~ *"/" ]] || [[ "${DEST}" == "/" ]]; then
rm -f "${DEST}.gitkeep"
else
rm -f "${DEST}/.gitkeep"
@ -49,7 +49,7 @@ if [[ ${#FILES[@]} -gt 0 ]]; then
fi
echo "Copying $FILE to $DEST"
cp -f $FILE $DEST
if [[ "${DEST}" =~ */ ]]; then
if [[ "${DEST}" =~ *"/" ]] || [[ "${DEST}" == "/" ]]; then
rm -f "${DEST}.gitkeep"
else
rm -f "${DEST}/.gitkeep"