From 7672002109b5856fc1b43df292bca4836fdb99d5 Mon Sep 17 00:00:00 2001 From: Vitaliy Zaytsev Date: Thu, 2 May 2024 14:20:54 +0300 Subject: [PATCH] use containerWorkspaceFolder var and pass it to setup.sh (#12) - folder name inside dev container is same as folder name on host so if it differs from qmk_userspace then setup.sh cannot be found and it sets incorrect user.overlay_dir - docs https://containers.dev/implementors/json_reference/ --- .devcontainer/devcontainer.json | 2 +- .devcontainer/setup.sh | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 2b7b817..7aaee1f 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -17,7 +17,7 @@ ] } }, - "postCreateCommand": "/workspaces/qmk_userspace/.devcontainer/setup.sh" + "postCreateCommand": "${containerWorkspaceFolder}/.devcontainer/setup.sh ${containerWorkspaceFolder}" // Features to add to the dev container. More info: https://containers.dev/features. // "features": {}, diff --git a/.devcontainer/setup.sh b/.devcontainer/setup.sh index 25c7c5e..9155c6c 100755 --- a/.devcontainer/setup.sh +++ b/.devcontainer/setup.sh @@ -9,13 +9,15 @@ rm get-pip.py python3 -m pip install --upgrade milc -git config --global --add safe.directory /workspaces/qmk_userspace +userspacePath="$1" + +git config --global --add safe.directory "$userspacePath" git submodule update --init --recursive [ -d /workspaces/qmk_firmware ] || git clone https://github.com/qmk/qmk_firmware.git /workspaces/qmk_firmware git config --global --add safe.directory /workspaces/qmk_firmware qmk config user.qmk_home=/workspaces/qmk_firmware -qmk config user.overlay_dir=/workspaces/qmk_userspace +qmk config user.overlay_dir="$userspacePath" qmk git-submodule