File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed
Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -94,9 +94,10 @@ __rsync_docs() {
9494 fi
9595 # Disable filename expansion (globbing)
9696 # https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html
97- set -f
98- rsync $rsync_opts -e " ssh -i $ssh_private_key_path " $local_path / " $ssh_host :$ssh_host_path "
99- set +f
97+ (
98+ set -f
99+ rsync $rsync_opts -e " ssh -i $ssh_private_key_path " $local_path / " $ssh_host :$ssh_host_path "
100+ )
100101}
101102
102103
Original file line number Diff line number Diff line change @@ -87,4 +87,14 @@ usage: rsync_docs.sh [OPTION]...
8787 assert_success
8888 refute_regex " $rsync_args " " --include /.htaccess "
8989 unstub rsync
90+ }
91+
92+ @test " when rsync fails script returns non-zero" {
93+ local dir=" ${BATS_RESOURCE_TEMP_DIR} /no-htaccess"
94+ stub rsync " exit 1"
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+ assert_failure
99+ unstub rsync
90100}
You can’t perform that action at this time.
0 commit comments