Skip to content

Commit 7672002

Browse files
authored
use containerWorkspaceFolder var and pass it to setup.sh (qmk#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/
1 parent 6ddb67d commit 7672002

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
]
1818
}
1919
},
20-
"postCreateCommand": "/workspaces/qmk_userspace/.devcontainer/setup.sh"
20+
"postCreateCommand": "${containerWorkspaceFolder}/.devcontainer/setup.sh ${containerWorkspaceFolder}"
2121

2222
// Features to add to the dev container. More info: https://containers.dev/features.
2323
// "features": {},

.devcontainer/setup.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,15 @@ rm get-pip.py
99

1010
python3 -m pip install --upgrade milc
1111

12-
git config --global --add safe.directory /workspaces/qmk_userspace
12+
userspacePath="$1"
13+
14+
git config --global --add safe.directory "$userspacePath"
1315
git submodule update --init --recursive
1416

1517
[ -d /workspaces/qmk_firmware ] || git clone https://github.com/qmk/qmk_firmware.git /workspaces/qmk_firmware
1618
git config --global --add safe.directory /workspaces/qmk_firmware
1719

1820
qmk config user.qmk_home=/workspaces/qmk_firmware
19-
qmk config user.overlay_dir=/workspaces/qmk_userspace
21+
qmk config user.overlay_dir="$userspacePath"
2022

2123
qmk git-submodule

0 commit comments

Comments
 (0)