Skip to content

Commit

Permalink
use containerWorkspaceFolder var and pass it to setup.sh (#12)
Browse files Browse the repository at this point in the history
- 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/
  • Loading branch information
kroleg authored May 2, 2024
1 parent 6ddb67d commit 7672002
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {},
Expand Down
6 changes: 4 additions & 2 deletions .devcontainer/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 7672002

Please sign in to comment.