From 0626efa7e8e8a46ef69dd54ec1fc1fe4302e02fb 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 3f721f3..fcc37d8 100755 --- a/bin/_blackbox_common.sh +++ b/bin/_blackbox_common.sh @@ -408,8 +408,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