Browse Source

Fix mac error in scripts/run-docker.sh

android-5
Fredrik Fornwall 6 years ago
parent
commit
85de1498fa
  1. 21
      scripts/run-docker.sh

21
scripts/run-docker.sh

@ -2,7 +2,8 @@
set -e -u set -e -u
HOME=/home/builder HOME=/home/builder
if [ `uname` = Darwin ]; then UNAME=$(uname)
if [ "$UNAME" = Darwin ]; then
# Workaround for mac readlink not supporting -f. # Workaround for mac readlink not supporting -f.
REPOROOT=$PWD REPOROOT=$PWD
else else
@ -25,14 +26,16 @@ docker start $CONTAINER_NAME > /dev/null 2> /dev/null || {
--volume $REPOROOT:$HOME/termux-packages \ --volume $REPOROOT:$HOME/termux-packages \
--tty \ --tty \
$IMAGE_NAME $IMAGE_NAME
if [ $(id -u) -ne 1000 -a $(id -u) -ne 0 ] if [ "$UNAME" != Darwin ]; then
then if [ $(id -u) -ne 1000 -a $(id -u) -ne 0 ]
echo "Changed builder uid/gid... (this may take a while)" then
docker exec --tty $CONTAINER_NAME chown -R $(id -u) $HOME echo "Changed builder uid/gid... (this may take a while)"
docker exec --tty $CONTAINER_NAME chown -R $(id -u) /data docker exec --tty $CONTAINER_NAME chown -R $(id -u) $HOME
docker exec --tty $CONTAINER_NAME usermod -u $(id -u) builder docker exec --tty $CONTAINER_NAME chown -R $(id -u) /data
docker exec --tty $CONTAINER_NAME groupmod -g $(id -g) builder docker exec --tty $CONTAINER_NAME usermod -u $(id -u) builder
fi docker exec --tty $CONTAINER_NAME groupmod -g $(id -g) builder
fi
fi
} }
if [ "$#" -eq "0" ]; then if [ "$#" -eq "0" ]; then

Loading…
Cancel
Save