From a370f293d8602c6afab44d9f5b40185a44f22aea Mon Sep 17 00:00:00 2001 From: Luciano Silva Date: Fri, 17 Feb 2017 21:29:43 -0500 Subject: [PATCH] Fix check script for stdout redirection --- assets/check | 3 --- assets/common.sh | 16 +--------------- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/assets/check b/assets/check index dc2b55a..24a2024 100755 --- a/assets/check +++ b/assets/check @@ -11,8 +11,6 @@ payload=$(mktemp $TMPDIR/concoure-curl-resource-request.XXXXXX) cat > $payload <&0 -cat $payload - url=$(jq -r '.source.url // ""' < $payload) # username=$(jq -r '.source.username // ""' < $payload) # password=$(jq -r '.source.password // ""' < $payload) @@ -31,6 +29,5 @@ trueValue="true" [ -n "$skip_ssl_verification" ] && [ "${skip_ssl_verification,,}" = "${trueValue,,}" ] && args_security="$args_security -k"; final_url=$(echo "$args_security" " $url") -echo $final_url check_version "$final_url" >&3 diff --git a/assets/common.sh b/assets/common.sh index cd1b594..503b1ce 100755 --- a/assets/common.sh +++ b/assets/common.sh @@ -1,19 +1,5 @@ set -e -exec 3>&1 # make stdout available as fd 3 for the result -exec 1>&2 # redirect all output to stderr for logging - -# in_file_with_version() { -# local artifacts_url=$1 -# local regex="(?$2)" -# local version=$3 -# -# result=$(artifactory_files "$artifacts_url" "$regex") -# echo $result | jq --arg v "$version" '[foreach .[] as $item ([]; $item ; if $item.version == $v then $item else empty end)]' -# -# } -# - # retrieve current file version # e.g. curl -R -I $1 check_version() { @@ -32,5 +18,5 @@ check_version() { local dateString=$(date +"$dateVersionFormat" -D %d\ %b\ %Y\ %H:%M:%S\ GMT -d "$tmpDateString") fi - echo "[{\"ref\":\"$dateString\"}]" | jq . + echo "{\"version\":\"$dateString\"}" | jq --slurp . }