Skip to content

Commit cbf5d55

Browse files
committed
Only run chown if the directory exists
1 parent 5ec054d commit cbf5d55

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

3.7.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,14 +156,15 @@ fix_permissions() {
156156
# When using Docker on Linux, the `rsync` command creates files owned by root.
157157
# Compute the user ID and group ID of this script on the non-Docker side, and ask
158158
# Docker to adjust permissions accordingly.
159-
docker run -v "${PWD}":/mnt/ --rm --entrypoint chown ubuntu:18.04 -R "$USER_AND_GROUP" /mnt/output/
159+
if [ -d output ] ; then
160+
docker run -v "${PWD}":/mnt/ --rm --entrypoint chown ubuntu:18.04 -R "$USER_AND_GROUP" /mnt/output/
161+
fi
160162
}
161163

162164
function main() {
163165
echo 'Starting Docker builds.'
164166

165167
# Clear the output directory.
166-
mkdir -p output
167168
fix_permissions
168169
rm -rf ./output/3.7
169170
mkdir -p output/3.7

0 commit comments

Comments
 (0)