aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorIdan Gazit <[email protected]>2020-10-10 01:42:50 +0000
committerIdan Gazit <[email protected]>2020-10-09 19:09:11 -0700
commit63ad5b7c089f13a5b5d5514514cc9ad7e798d3e8 (patch)
treef86942289453ecd199b6226a5a00c4ea9ee89f00
parentdb40fbad598b6f84472cb2921df89f1a46fc6b5c (diff)
downloadzmk-63ad5b7c089f13a5b5d5514514cc9ad7e798d3e8.tar.gz
zmk-63ad5b7c089f13a5b5d5514514cc9ad7e798d3e8.zip
Inject $WORKSPACE_DIR into container
This permits users to check ZMK out into arbitrarily-named directories
-rw-r--r--.devcontainer/.bashrc4
-rw-r--r--.devcontainer/devcontainer.json3
2 files changed, 4 insertions, 3 deletions
diff --git a/.devcontainer/.bashrc b/.devcontainer/.bashrc
index 6a6ea69111..855ea75520 100644
--- a/.devcontainer/.bashrc
+++ b/.devcontainer/.bashrc
@@ -1,6 +1,6 @@
export LS_OPTIONS='-F --color=auto'
eval "`dircolors`"
alias ls='ls $LS_OPTIONS'
-if [ -f /workspaces/zmk/zephyr/zephyr-env.sh ]; then
- source /workspaces/zmk/zephyr/zephyr-env.sh
+if [ -f "$WORKSPACE_DIR/zephyr/zephyr-env.sh" ]; then
+ source "$WORKSPACE_DIR/zephyr/zephyr-env.sh"
fi
diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json
index f21465df24..940b78b8de 100644
--- a/.devcontainer/devcontainer.json
+++ b/.devcontainer/devcontainer.json
@@ -2,6 +2,7 @@
"name": "ZMK Development",
"dockerFile": "Dockerfile",
"extensions": ["ms-vscode.cpptools"],
- "runArgs": ["--security-opt", "label=disable"]
+ "runArgs": ["--security-opt", "label=disable"],
+ "containerEnv": {"WORKSPACE_DIR": "${containerWorkspaceFolder}"}
}