3 Commits

Author SHA1 Message Date
Michael Stapelberg
2c805ed001 refactor cobra command initialization to avoid stale state
Before this commit, we held onto *cobra.Command objects,
but that is not actually supported: after the first Execute(),
commands like updateCmd are stuck on the first-ever provided ctx.

Instead, turn command initialization into functions.

I only noticed this when trying to do two 'gok update'
from within the same test, where the fake build timestamp
is injected via the context (the timestamp was always the same).
2025-11-29 10:47:48 +01:00
Michael Stapelberg
231dea4b57 gok edit: run $EDITOR/$VISUAL through /bin/sh -c
This makes command line arguments in these environment variables work,
e.g. 'code -w', or 'emacs -q'

fixes https://github.com/gokrazy/gokrazy/issues/217
2023-09-21 19:13:28 +02:00
Michael Stapelberg
ce2433aa1a gok: move code to internal/gok 2023-01-29 19:30:23 +01:00