exec prints the install of a missing version to stdout, next to the output of the command

Aperta Adatta ai principianti
#823 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
go, shell
Ambito
cli

Direzione di ricerca

L'output indesiderato proviene da cmd/commands/exec.go vicino alla riga 169, dove fmt.Printf stampa il messaggio 'not found, installing', e da internal/sdk/sdk.go intorno alle righe 388 e 434, dove pterm.Printf scrive i messaggi di installazione sullo standard output. Inizia leggendo questi punti di chiamata e verifica se possono scrivere sullo standard error. È fatto quando vfox exec [email protected] -- etcd --version 2>/dev/null | head -1 stampa per primo l'output del comando stesso e i messaggi di installazione non compaiono più su stdout.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

vfox exec installs a version that is not installed yet, as the "Auto Install" tip in docs/usage/core-commands.md says. The messages of that install go to standard output, which is also where the output of the command goes. A pipeline that reads the output of the command therefore gets the install messages first.

Reproduction on a GitHub-hosted runner (Ubuntu 26.04.1, x86_64) with the vfox 1.1.0 release archive (checksum verified) and the zip archive of the vfox-etcd v0.2.3 tag. Run: https://github.com/version-fox/vfox-plus/actions/runs/45056971190

vfox add --source vfox-etcd-v0.2.3.zip
vfox exec [email protected] -- etcd --version 2>/dev/null | head -1

Actual output: the first line is SDK [email protected] not found, installing....

The complete standard output of vfox exec [email protected] -- etcd --version in the same run starts with:

SDK [email protected] not found, installing...
etcd download url: https://github.com/etcd-io/etcd/releases/download/v3.5.12/etcd-v3.5.12-linux-amd64.tar.gz
Preinstalling [email protected]...
Verifying checksum f2ff0cb4...
Unpacking .../etcd-v3.5.12-linux-amd64.tar.gz...
etcd installed path: .../v-3.5.12/etcd-3.5.12

and then the output of etcd --version. The download progress is on standard error. After the install, the same command's standard output starts with etcd Version: 3.5.12.

Expected: the messages of the installation go to standard error, so that the standard output of vfox exec ... -- <command> is the output of the command.

Where it comes from: cmd/commands/exec.go:169 prints SDK %s@%s not found, installing... with fmt.Printf. internal/sdk/sdk.go:388 and internal/sdk/sdk.go:434 print the install messages with pterm.Printf, which writes to standard output. The plugin's own print calls, such as the download URL above, also write to standard output.

The docs recommend vfox exec for Docker and CI (docs/usage/core-commands.md), where the output of the command is often captured.

Lingua principale
Go
Stelle
4k
Fork
177
Merge medio
1g 20h
PR unite (30g)
31

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di version-fox/vfox

Tutte le issue di version-fox/vfox

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.