Skip to content

Commit 415e2b1

Browse files
committed
Partial Build does not include site-manifest.json
Closes gh-40
1 parent 4b758cb commit 415e2b1

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

rsync-antora-reference/src/rsync_docs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ __rsync_docs() {
8989
fi
9090
rsync_opts="$rsync_opts --exclude /.github-repository --exclude /.cache --exclude /.cache/* "
9191
if [ -n "$build_ref_name" ]; then
92-
rsync_opts="-c $rsync_opts$(find $local_path -mindepth 1 -maxdepth 1 \! -name 404.html \! -name '.*' -type f -printf ' --include /%P')"
92+
rsync_opts="-c $rsync_opts$(find $local_path -mindepth 1 -maxdepth 1 \! -name 404.html \! -name site-manifest.json \! -name '.*' -type f -printf ' --include /%P')"
9393
rsync_opts="$rsync_opts$(find $local_path -mindepth 1 -maxdepth 1 -type d \! -name _ -printf ' --include /%P --include /%P/**') --exclude **"
9494
fi
9595
# Disable filename expansion (globbing)

rsync-antora-reference/test/resources/test-rsync_docs.bats/has-site-manifest/site-manifest.json

Whitespace-only changes.

rsync-antora-reference/test/test-rsync_docs.bats

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,18 @@ usage: rsync_docs.sh [OPTION]...
8989
unstub rsync
9090
}
9191

92+
@test "when build_ref_name then site-manifest.json not included" {
93+
local dir="${BATS_RESOURCE_TEMP_DIR}/has-site-manifest"
94+
stub rsync "$(capture_program_args "rsync")"
95+
96+
run rsync_docs.sh --ssh-host HOST --build-ref-name main --ssh-host-path HOST_PATH --ssh-private-key-path PRIVATE_KEY_PATH --local-path "$dir"
97+
98+
local rsync_args=$(get_program_args "rsync")
99+
assert_success
100+
refute_regex "$rsync_args" " --include /site-manifest.json"
101+
unstub rsync
102+
}
103+
92104
@test "when rsync fails script returns non-zero" {
93105
local dir="${BATS_RESOURCE_TEMP_DIR}/no-htaccess"
94106
stub rsync "exit 1"

0 commit comments

Comments
 (0)