From b493330c7d6c0abaa10b4c9f4d8cf3380d02d703 Mon Sep 17 00:00:00 2001 From: David Personette Date: Tue, 3 Sep 2019 19:09:52 -0400 Subject: [PATCH] fix hooks scripts --- hooks/post_checkout | 12 ++++++------ hooks/pre_build | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/hooks/post_checkout b/hooks/post_checkout index 880ef72..c5156ab 100644 --- a/hooks/post_checkout +++ b/hooks/post_checkout @@ -1,16 +1,16 @@ #!/usr/bin/env bash -BUILD_ARCH=$(echo "${DOCKERFILE_PATH}" | cut -d '.' -f2) +BUILD_ARCH=$(echo "${DOCKERFILE_PATH}" | cut -d'.' -f2) [ "${BUILD_ARCH}" == "Dockerfile" ] && \ { echo 'qemu-user-static: Download not required for this arch'; exit 0; } TAGS_API="https://api.github.com/repos/multiarch/qemu-user-static/tags" URL="https://github.com/multiarch/qemu-user-static/releases/download" -LATEST_TAG=$(curl -LSs $TAGS_API \ - | awk -F'"' '/name.*v[0-9]/ {print $4; exit}') +LATEST_TAG=$(curl -Ls $TAGS_API | \ + awk -F'"' '/name.*v[0-9]/ {print $4; exit}') STATIC_ARCH=$([ "${BUILD_ARCH}" == "armhf" ] && \ - echo "${BUILD_ARCH::-2}" || echo "${BUILD_ARCH}") + echo "${BUILD_ARCH::-2}" || echo "${BUILD_ARCH}") -curl -LSs "${URL}/${LATEST_TAG}/x86_64_qemu-${STATIC_ARCH}-static.tar.gz" \ - | tar xzv +curl -Ls "${URL}/${LATEST_TAG}/x86_64_qemu-${STATIC_ARCH}-static.tar.gz" | \ + tar xzv \ No newline at end of file diff --git a/hooks/pre_build b/hooks/pre_build index 98648f2..88ae845 100644 --- a/hooks/pre_build +++ b/hooks/pre_build @@ -1,8 +1,8 @@ #!/usr/bin/env bash -BUILD_ARCH=$(echo "${DOCKERFILE_PATH}" | cut -d '.' -f2) +BUILD_ARCH=$(echo "${DOCKERFILE_PATH}" | cut -d'.' -f2) [ "${BUILD_ARCH}" == "Dockerfile" ] && \ { echo 'qemu-user-static: Registration not required for this arch';exit 0; } -docker run --rm --privileged multiarch/qemu-user-static:register --reset +docker run --rm --privileged multiarch/qemu-user-static:register --reset \ No newline at end of file