Skip to content

Commit 2f13af8

Browse files
committed
Apply suggestions from code review
1 parent 23e195f commit 2f13af8

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

repo2docker/buildpacks/base.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,10 @@
106106
# Allow target path repo is cloned to be configurable
107107
ARG REPO_DIR=${HOME}
108108
ENV REPO_DIR=${REPO_DIR}
109-
RUN if [ ! -d "${REPO_DIR}" ] \
110-
; then \
111-
mkdir -p "${REPO_DIR}" \
112-
&& chown -R ${NB_USER}:${NB_USER} "${REPO_DIR}" \
113-
; else \
114-
echo "${REPO_DIR} already exists..." \
115-
; fi
109+
# Create a folder and grant the user permissions if it doesn't exist
110+
RUN if [ ! -d "${REPO_DIR}" ]; then \
111+
/usr/bin/install -o ${NB_USER} -g ${NB_USER} -d "${REPO_DIR}"; \
112+
fi
116113
117114
WORKDIR ${REPO_DIR}
118115
RUN chown ${NB_USER}:${NB_USER} ${REPO_DIR}

0 commit comments

Comments
 (0)