From abae64e44ec6863be390dda26b13d1b379584731 Mon Sep 17 00:00:00 2001 From: Gaurav Saini <147703805+gauravsaini04@users.noreply.github.com> Date: Mon, 28 Oct 2024 08:22:30 +0000 Subject: [PATCH] [cpp] - settable clonable commits value - vcpkg --- src/cpp/.devcontainer/Dockerfile | 3 ++- src/cpp/.devcontainer/base-scripts/install-vcpkg.sh | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/cpp/.devcontainer/Dockerfile b/src/cpp/.devcontainer/Dockerfile index fd45e63d4..59df6094e 100644 --- a/src/cpp/.devcontainer/Dockerfile +++ b/src/cpp/.devcontainer/Dockerfile @@ -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. diff --git a/src/cpp/.devcontainer/base-scripts/install-vcpkg.sh b/src/cpp/.devcontainer/base-scripts/install-vcpkg.sh index 06467af96..0c1762e8d 100644 --- a/src/cpp/.devcontainer/base-scripts/install-vcpkg.sh +++ b/src/cpp/.devcontainer/base-scripts/install-vcpkg.sh @@ -7,6 +7,7 @@ set -e USERNAME=${1:-"vscode"} +CLONE_COMMITS=${2:-1} . /etc/os-release @@ -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 \