File tree 2 files changed +14
-3
lines changed
2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -94,9 +94,10 @@ __rsync_docs() {
94
94
fi
95
95
# Disable filename expansion (globbing)
96
96
# 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
+ )
100
101
}
101
102
102
103
Original file line number Diff line number Diff line change @@ -87,4 +87,14 @@ usage: rsync_docs.sh [OPTION]...
87
87
assert_success
88
88
refute_regex " $rsync_args " " --include /.htaccess "
89
89
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
90
100
}
You can’t perform that action at this time.
0 commit comments