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

オープン 初心者向け
#823 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
72/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
go, shell
領域
cli

調査の方向性

余計な出力は、cmd/commands/exec.go の169行目付近にある fmt.Printf が 'not found, installing' メッセージを表示している箇所と、internal/sdk/sdk.go の388行目と434行目付近にある pterm.Printf がインストールメッセージを標準出力に書き込んでいる箇所から出ています。まずこれらの呼び出し箇所を読み、標準エラー出力に書き込めるかどうかを確認してください。vfox exec [email protected] -- etcd --version 2>/dev/null | head -1 がまずコマンド自身の出力を表示し、インストールメッセージが標準出力に現れなくなれば完了です。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Go
スター
4k
フォーク
177
平均マージ
1日 20時間
マージ済み PR(30日)
31

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

version-fox/vfox のほかの issue

version-fox/vfox の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。