mirror of
https://github.com/cpina/github-action-push-to-another-repository.git
synced 2024-12-22 08:06:10 -07:00
Avoid unneeded check
This commit is contained in:
parent
df5ac1b335
commit
371fdd6652
|
@ -42,11 +42,12 @@ TEMP_DIR=$(mktemp -d)
|
||||||
mv "$CLONE_DIR/.git" "$TEMP_DIR/.git"
|
mv "$CLONE_DIR/.git" "$TEMP_DIR/.git"
|
||||||
|
|
||||||
echo "[+] Checking if $TARGET_DIRECTORY exist in git repo $DESTINATION_REPOSITORY_NAME"
|
echo "[+] Checking if $TARGET_DIRECTORY exist in git repo $DESTINATION_REPOSITORY_NAME"
|
||||||
|
|
||||||
# Remove contents of target directory and create a new empty one
|
# Remove contents of target directory and create a new empty one
|
||||||
if [ -d "$CLONE_DIR/$TARGET_DIRECTORY/" ]
|
if [ -d "$CLONE_DIR/$TARGET_DIRECTORY/" ]
|
||||||
then
|
then
|
||||||
echo "[+] Deleting files from $TARGET_DIRECTORY in git repo $DESTINATION_REPOSITORY_NAME"
|
echo "[+] Deleting files from $TARGET_DIRECTORY in git repo $DESTINATION_REPOSITORY_NAME"
|
||||||
rm -R "${CLONE_DIR:?}/$TARGET_DIRECTORY/"
|
rm -R "$CLONE_DIR/$TARGET_DIRECTORY/"
|
||||||
fi
|
fi
|
||||||
echo "[+] Creating $TARGET_DIRECTORY if doesnt already exist"
|
echo "[+] Creating $TARGET_DIRECTORY if doesnt already exist"
|
||||||
mkdir -p "$CLONE_DIR/$TARGET_DIRECTORY"
|
mkdir -p "$CLONE_DIR/$TARGET_DIRECTORY"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user