Skip to content

Commit

Permalink
Disable a few shellcheck warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
sengaya committed Oct 3, 2023
1 parent 3ad866e commit f2a541f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions s3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ s3_ls() {
request_url="$(create_request_url "${service}" ls "${_arg_endpoint_url}" "${region}" "${bucket}" "${key}")"

if [[ "${_arg_no_sign_request}" = "on" ]]; then
# shellcheck disable=SC2086
${dryrun} curl ${curl_output} --fail "${request_url}" | "${formatter}"
else
headers=("host:$(get_host_from_request_url "$request_url")" "x-amz-content-sha256:${content_sha256}" "x-amz-date:${date}" "${security_token_header:-}")
Expand Down Expand Up @@ -95,9 +96,11 @@ Error: Invalid argument type" # or <S3Uri> <S3Uri> (not yet implemented)

if [[ "${_arg_no_sign_request}" = "on" ]]; then
if [[ "${http_method}" == "PUT" ]]; then
# shellcheck disable=SC2086
${dryrun} curl ${curl_output} --fail -X "${http_method}" "${request_url}" --data-binary "@${source}" -o /dev/null
echo "upload: ${source} to s3://${bucket}/${key}"
else
# shellcheck disable=SC2086
${dryrun} curl ${curl_output} --fail "${request_url}" -o "${destination}"
echo "download: ${source} to ${destination}"
fi
Expand Down
1 change: 1 addition & 0 deletions s3api.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ s3api_create-bucket() {
request_url="$(create_request_url "${service}" "" "${_arg_endpoint_url}" "${region}" "${bucket}" "")"

if [[ "${_arg_no_sign_request}" = "on" ]]; then
# shellcheck disable=SC2086
${dryrun} curl ${curl_output} --fail -X "${http_method}" "${request_url}" -H "Content-Length: 0" -o /dev/null
else
headers=("host:$(get_host_from_request_url "$request_url")" "x-amz-content-sha256:${content_sha256}" "x-amz-date:${date}" "${security_token_header:-}")
Expand Down
1 change: 1 addition & 0 deletions sts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ sts_assume-role() {
content_sha256="$(sha256 "${body}")"

if [[ "${_arg_no_sign_request}" = "on" ]]; then
# shellcheck disable=SC2086
${dryrun} curl ${curl_output} --fail "${request_url}" --data "${body}"
else
headers=("host:$(get_host_from_request_url "$request_url")" "x-amz-date:${date}" "content-type:application/x-www-form-urlencoded;charset=utf-8" "${security_token_header:-}")
Expand Down

0 comments on commit f2a541f

Please sign in to comment.