Skip to content

Commit

Permalink
[cpp] - settable clonable commits value - vcpkg
Browse files Browse the repository at this point in the history
  • Loading branch information
gauravsaini04 committed Oct 28, 2024
1 parent 8e43def commit abae64e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/cpp/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ ENV VCPKG_ROOT=/usr/local/vcpkg \
ENV PATH="${PATH}:${VCPKG_ROOT}"

ARG USERNAME=vscode
ARG CLONE_COMMITS=1

# Install vcpkg itself: https://github.com/microsoft/vcpkg/blob/master/README.md#quick-start-unix
COPY base-scripts/install-vcpkg.sh /tmp/
RUN chmod +x /tmp/install-vcpkg.sh \
&& ./tmp/install-vcpkg.sh ${USERNAME} \
&& ./tmp/install-vcpkg.sh ${USERNAME} ${CLONE_COMMITS} \
&& rm -f /tmp/install-vcpkg.sh

# [Optional] Uncomment this section to install additional OS packages.
Expand Down
3 changes: 2 additions & 1 deletion src/cpp/.devcontainer/base-scripts/install-vcpkg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
set -e

USERNAME=${1:-"vscode"}
CLONE_COMMITS=${2:-1}

. /etc/os-release

Expand Down Expand Up @@ -56,7 +57,7 @@ usermod -a -G "vcpkg" "${USERNAME}"
# Clone repository with ports and installer
mkdir -p "${VCPKG_ROOT}"
mkdir -p "${VCPKG_DOWNLOADS}"
git clone --depth=1 \
git clone --depth=${CLONE_COMMITS} \
-c core.eol=lf \
-c core.autocrlf=false \
-c fsck.zeroPaddedFilemode=ignore \
Expand Down

0 comments on commit abae64e

Please sign in to comment.