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/
This commit is contained in:
Vitaliy Zaytsev 2024-05-02 14:20:54 +03:00 committed by GitHub
parent 6ddb67dc56
commit 7672002109
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 3 deletions

View file

@ -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": {},

View file

@ -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