From 9165a77d15205cae1a896e1d30e4338f32708767 Mon Sep 17 00:00:00 2001 From: James Gregory Date: Fri, 1 Sep 2017 22:01:20 +1000 Subject: [PATCH] Fixed Alpine compatibility (chmod) (#212) --- bin/_blackbox_common.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bin/_blackbox_common.sh b/bin/_blackbox_common.sh index bf989a1..cb3f9fd 100755 --- a/bin/_blackbox_common.sh +++ b/bin/_blackbox_common.sh @@ -443,8 +443,12 @@ function cp_permissions() { chmod $( stat -f '%p' "$1" | sed -e "s/^100//" ) "${@:2}" ;; Linux | CYGWIN* | MINGW* ) - chmod --reference "$1" "${@:2}" - ;; + if [[ -e /etc/alpine-release ]]; then + chmod $( stat -c '%a' "$1" ) "${@:2}" + else + chmod --reference "$1" "${@:2}" + fi + ;; * ) echo 'ERROR: Unknown OS. Exiting. (cp_permissions)' exit 1