File tree Expand file tree Collapse file tree 3 files changed +13
-1
lines changed
resources/test-rsync_docs.bats/has-site-manifest Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Original file line number Diff line number Diff 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)
Original file line number Diff line number Diff 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"
You can’t perform that action at this time.
0 commit comments