You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To summarize, storing the configs in ~/gokrazy by default seemed really weird, it feels like something that should be in a repository. Not necessarily the app repo, but maybe a "gokrazy instance" repo.
So I guess this bug is the same as that Anisse's comment. My concrete proposal is:
Keep the current behavior, but with a search step in the middle, akin to how git walks up the tree looking for a .git dir:
If GOKRAZY_PARENT_DIR isn't defined in the environment, walk up pwd (to a maximum root of $HOME), looking for $DIR/gokrazy, stopping at the first dir found.
Then if I'm in my private git repo, I can put a "gokrazy" in there and gok will use those.
The text was updated successfully, but these errors were encountered:
stapelberg
changed the title
Feature request: more flexibility in gok --parent_dir
Feature request: discover GOKRAZY_PARENT_DIR by walking $PWD up (til $HOME)
Apr 14, 2023
Seems like a reasonable request. The only (small) downside is the potential for picking up gokrazy directories incorrectly. E.g. when working in ~/go/src/github.com/gokrazy/breakglass, it should not pick up ~/go/src/github.com/gokrazy as an instance dir. Maybe we should keep ~/gokrazy as default and first search location, and only do the $PWD walking if ~/gokrazy does not exist (and $GOKRAZY_PARENT_DIR is empty of course)
I want to store a number of my gokrazy configs together in a single git repo, not in $HOME/gokrazy.
But I also don't want to type
gok --parent_dir=$HOME/src/github.com/bradfitz/private/gokrazy -i mosquitto ....
every time.Currently, as defined,
https://github.com/gokrazy/internal/blob/5f469e7488b0/instanceflag/instanceflag.go#L74-L78
https://github.com/gokrazy/internal/blob/5f469e7488b0/instanceflag/instanceflag.go#L14-L23
... the behavior is today:
I actually missed any docs about GOKRAZY_PARENT_DIR but while researching it found Anisse also confused (https://mas.to/@aissen@octodon.social/109688845672265750), saying:
So I guess this bug is the same as that Anisse's comment. My concrete proposal is:
Keep the current behavior, but with a search step in the middle, akin to how git walks up the tree looking for a
.git
dir:If GOKRAZY_PARENT_DIR isn't defined in the environment, walk up pwd (to a maximum root of $HOME), looking for $DIR/gokrazy, stopping at the first dir found.
Then if I'm in my private git repo, I can put a "gokrazy" in there and gok will use those.
The text was updated successfully, but these errors were encountered: