Skip to content

Commit

Permalink
Update setup.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronBrennan1 authored Sep 10, 2024
1 parent 2f5f24c commit c403b2c
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,20 @@ git checkout gh-pages
TARGET_DIR="stable/tutorials/$(dirname "$FILE_PATH")"
echo "Target directory: $TARGET_DIR"

# Create the target directory in the destination repository if it doesn't exist
echo "Creating the target directory if it doesn't exist..."
mkdir -p $TARGET_DIR

# Delete all contents in the target directory
# echo "Deleting all contents in the target directory..."
# rm -rf $TARGET_DIR/*
# Check if the target directory is exactly "stable/tutorials"
if [[ "$TARGET_DIR" == "stable/tutorials" ]]; then
echo "Target directory is 'stable/tutorials'. Do not delete."
else
echo "Target directory is not 'stable/tutorials'. Proceeding with deletion."

# Create the target directory in the destination repository if it doesn't exist
echo "Creating the target directory if it doesn't exist..."
mkdir -p $TARGET_DIR

# Delete all contents in the target directory
echo "Deleting all contents in the target directory..."
rm -rf $TARGET_DIR/*
fi

# Add, commit and push the files to the destination repository
echo "Adding changes to git..."
Expand Down

0 comments on commit c403b2c

Please sign in to comment.