What happened?
In a plugin, I want to use the {{ .DevboxDirRoot }} placeholder. According to the docs, this placeholder "points to the root folder of their project, where the user's devbox.json is stored."
Instead, it points to <projectRoot>/devbox.d
Steps to reproduce
- Init a Devbox environment
- Create a plugin that has
"cd {{ .DevboxDirRoot }} && pwd" in its init_hook
- Include the plugin in the
devbox.json
- Run
devbox shell
Command
shell
devbox.json
devbox.json
{
"$schema": "https://raw.githubusercontent.com/jetpack-io/devbox/0.10.4/.schema/devbox.schema.json",
"include": [
"path:./.config/plugins/a/plugin.json"
],
"packages": [],
"shell": {
"init_hook": [
"echo 'Welcome to devbox!' > /dev/null"
],
"scripts": {
"test": [
"echo \"Error: no test specified\" && exit 1"
]
}
}
}
./.config/plugins/a/plugin.json
{
"name": "plugin-a",
"version": "0.0.1",
"description": "A plugin.",
"packages": [],
"shell": {
"init_hook": [
"cd {{ .DevboxDirRoot }} && pwd"
]
}
}
Devbox version
0.10.4
Nix version
nix (Nix) 2.19.3
What system does this bug occur on?
macOS (Apple Silicon)
Debug logs
Let me know if you need more output.
2024/04/10 21:01:26 findProjectDir: path is
2024/04/10 21:01:26 finding devbox config in dir: /Users/m/plugin-placeholders
/Users/m/plugin-placeholders/.devbox/gen/scripts/.raw-hooks.sh:cd:1: no such file or directory: /Users/m/plugin-placeholders/devbox.d
What happened?
In a plugin, I want to use the
{{ .DevboxDirRoot }}placeholder. According to the docs, this placeholder "points to the root folder of their project, where the user's devbox.json is stored."Instead, it points to
<projectRoot>/devbox.dSteps to reproduce
"cd {{ .DevboxDirRoot }} && pwd"in itsinit_hookdevbox.jsondevbox shellCommand
shell
devbox.json
devbox.json{ "$schema": "https://raw.githubusercontent.com/jetpack-io/devbox/0.10.4/.schema/devbox.schema.json", "include": [ "path:./.config/plugins/a/plugin.json" ], "packages": [], "shell": { "init_hook": [ "echo 'Welcome to devbox!' > /dev/null" ], "scripts": { "test": [ "echo \"Error: no test specified\" && exit 1" ] } } }./.config/plugins/a/plugin.json{ "name": "plugin-a", "version": "0.0.1", "description": "A plugin.", "packages": [], "shell": { "init_hook": [ "cd {{ .DevboxDirRoot }} && pwd" ] } }Devbox version
0.10.4
Nix version
nix (Nix) 2.19.3
What system does this bug occur on?
macOS (Apple Silicon)
Debug logs
Let me know if you need more output.