Fixed Alpine compatibility (chmod) (#212)

This commit is contained in:
James Gregory
2017-09-01 22:01:20 +10:00
committed by Tom Limoncelli
parent c60ca184f3
commit 0626efa7e8

View File

@@ -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