Keep the mnemonic variables from the mnemonic command (closes #80)
check / check (push) Waiting to run
check / check (push) Waiting to run
The mnemonic command ran with the tool's whole environment, so a mnemonic set in KEYFUNC_MNEMONIC reached it, although the command is there to supply one of its own. It now gets the environment ssh and sftp already get, with KEYFUNC_MNEMONIC and KEYFUNC_MNEMONIC_COMMAND removed. The function that builds that environment moves from the ssh command group into internal/mnemonic, beside the two variable names, so all three programs use the one copy. The README says so. A mnemonic command that runs keyfunc itself no longer finds the main mnemonic in either variable. Model: opus-5-5 Co-authored-by: clawbot <sneak+clawbot@sneak.cloud>
This commit was merged in pull request #83.
This commit is contained in:
@@ -11,6 +11,7 @@ import (
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
"sneak.berlin/go/keyfunc/internal/cli/signals"
|
||||
"sneak.berlin/go/keyfunc/internal/mnemonic"
|
||||
)
|
||||
|
||||
// StatusError says the tool should end with the status ssh ended with.
|
||||
@@ -79,7 +80,7 @@ func to() *cobra.Command {
|
||||
func connect(ctx context.Context, argv []string) error {
|
||||
//nolint:gosec // the arguments are the user's own, meant for ssh
|
||||
command := exec.CommandContext(ctx, "ssh", argv...)
|
||||
command.Env = childEnv()
|
||||
command.Env = mnemonic.ChildEnv()
|
||||
command.Stdin = os.Stdin
|
||||
command.Stdout = os.Stdout
|
||||
command.Stderr = os.Stderr
|
||||
|
||||
Reference in New Issue
Block a user