devbox icon indicating copy to clipboard operation
devbox copied to clipboard

Feature Request: Allow User To Specific Name Of Config File

Open gfleetwood opened this issue 3 years ago • 3 comments

if I change the name of devbox.json to something else then devbox shell throws an error:

Error: open devbox.json: no such file or directory
Usage:
  devbox shell [<dir>] [flags]

Flags:
  -h, --help   help for shell

But I'd like to have files for specific tasks - like editing pdfs - and want to use the filename as a guide, ex: devbox_pdf.json. It would be good to have that option.

gfleetwood avatar Sep 12 '22 02:09 gfleetwood

Interesting idea!

@gfleetwood Are you looking to do something like this?

devbox shell file1.json # Uses file1.json instead of `devbox.json`

loreto avatar Sep 12 '22 14:09 loreto

Exactly. devbox shell can default to looking for devbox.json but I should be able to supply a file name as well.

gfleetwood avatar Sep 12 '22 15:09 gfleetwood

Maybe changing this line by : https://github.com/jetpack-io/devbox/blob/930867bf4e84f370b4c42a9797a7ee85821f8483/devbox.go#L22-L23

// configFilename is name of the JSON file that defines a devbox environment.
// it can be set by DEVBOX_CONFIG env var or falling back to devbox.json

val, ok := os.LookupEnv(key)
if !ok {
    val = "devbox.json"
}
const configFilename = val

QuentinN42 avatar Sep 30 '22 07:09 QuentinN42