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

I forgot to account for the literal `/` folder scenario
This commit is contained in:
fiftydinar 2024-07-21 16:08:21 +02:00
parent 22146815d4
commit c8aa0fa4b6

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"