Skip to content

Commit ebfb3df

Browse files
committed
btter script
1 parent b6d0a7d commit ebfb3df

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

.github/workflows/docusaurus_sync.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,19 @@ jobs:
8787
rsync -av --delete --exclude='.git/' "$SOURCE_PATH/" "$DEST_PATH/"
8888
8989
echo "Syncing to all versioned documentation paths"
90-
# Find all version directories and sync to each one
91-
for version_dir in "$VERSIONED_DEST_PATH"/version-*/experiments-api; do
92-
echo "Syncing to $version_dir"
93-
mkdir -p "$version_dir"
94-
rsync -av --delete --exclude='.git/' "$SOURCE_PATH/" "$version_dir/"
95-
done
90+
# Check if versioned docs directory exists and find existing version directories
91+
if [ -d "$VERSIONED_DEST_PATH" ]; then
92+
for version_dir in "$VERSIONED_DEST_PATH"/version-*; do
93+
if [ -d "$version_dir" ]; then
94+
experiments_api_dir="$version_dir/experiments-api"
95+
echo "Syncing to $experiments_api_dir"
96+
mkdir -p "$experiments_api_dir"
97+
rsync -av --delete --exclude='.git/' "$SOURCE_PATH/" "$experiments_api_dir/"
98+
fi
99+
done
100+
else
101+
echo "No versioned docs directory found at $VERSIONED_DEST_PATH"
102+
fi
96103
97104
- name: Show Git Status
98105
run: |

0 commit comments

Comments
 (0)