Skip to content

Commit

Permalink
Merge #309
Browse files Browse the repository at this point in the history
309: Use local variables in Bash function. r=reitermarkus a=reitermarkus



Co-authored-by: Markus Reiter <[email protected]>
  • Loading branch information
bors[bot] and reitermarkus authored Sep 6, 2019
2 parents fca3a05 + 299e25f commit ffa16a5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions build-docker-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ run() {
local image_name="rustembedded/cross:${1}"

if docker pull "${image_name}"; then
cache_from_args=(--cache-from "${image_name}")
local cache_from_args=(--cache-from "${image_name}")
fi

docker build ${cache_from_args[@]} --pull -t "${image_name}" -f "${dockerfile}" .

version="$(cargo metadata --format-version 1 | jq --raw-output '.packages[] | select(.name == "cross") | .version')"
local version="$(cargo metadata --format-version 1 | jq --raw-output '.packages[] | select(.name == "cross") | .version')"

if ! [[ "${version}" =~ alpha ]] && ! [[ "${version}" =~ dev ]]; then
versioned_image_name="${image_name}-${version}"
local versioned_image_name="${image_name}-${version}"
docker tag "${image_name}" "${versioned_image_name}"
fi
}
Expand Down

0 comments on commit ffa16a5

Please sign in to comment.