Skip to content

Commit

Permalink
Move to script.
Browse files Browse the repository at this point in the history
  • Loading branch information
tzarc committed Feb 21, 2024
1 parent 9f39607 commit 26bc16c
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
]
}
},
"postCreateCommand": "git config --global --add safe.directory /workspaces/qmk_userspace && git submodule update --init --recursive && { [ -d /workspaces/qmk_userspace/qmk_firmware ] || git clone https://github.com/qmk/qmk_firmware.git /workspaces/qmk_userspace/qmk_firmware; } && git config --global --add safe.directory /workspaces/qmk_userspace/qmk_firmware && qmk config user.qmk_home=/workspaces/qmk_userspace/qmk_firmware && qmk config user.overlay_dir=/workspaces/qmk_userspace && qmk git-submodule"
"postCreateCommand": "/workspaces/qmk_userspace/.devcontainer/setup.sh"

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},
Expand Down
34 changes: 34 additions & 0 deletions .devcontainer/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/env bash

set -eEuo pipefail

wget https://bootstrap.pypa.io/get-pip.py
python3 get-pip.py
python3 -m pip install qmk
rm get-pip.py

git config --global --add safe.directory /workspaces/qmk_userspace
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 git-submodule

cat << __EOF__ > /workspaces/qmk_userspace/devcontainer.code-workspace
{
"folders": [
{
"name": "qmk_userspace",
"path": "/workspaces/qmk_userspace"
},
{
"name": "qmk_firmware",
"path": "/workspaces/qmk_firmware"
},
],
}
__EOF__

0 comments on commit 26bc16c

Please sign in to comment.