refactor(web): remove useless --version fallback

This commit is contained in:
lc6464 2026-03-27 20:00:41 +08:00
parent c2d2ee6ae8
commit 68e8b7e936
No known key found for this signature in database
GPG key ID: 53C61B42FEC71D6D

View file

@ -83,19 +83,14 @@ func (h *Handler) resolveSystemVersionInfo() systemVersionResponse {
return parsed return parsed
} }
// executePicoclawVersion runs version commands against the discovered picoclaw // executePicoclawVersion runs the version subcommand against the
// executable. It tries subcommand form first, then --version fallback. // discovered picoclaw executable.
func executePicoclawVersion(ctx context.Context, execPath string) (string, error) { func executePicoclawVersion(ctx context.Context, execPath string) (string, error) {
out, err := exec.CommandContext(ctx, execPath, "version").CombinedOutput() out, err := exec.CommandContext(ctx, execPath, "version").CombinedOutput()
if err == nil { if err == nil {
return string(out), nil return string(out), nil
} }
flagOut, flagErr := exec.CommandContext(ctx, execPath, "--version").CombinedOutput()
if flagErr == nil {
return string(flagOut), nil
}
return string(out), fmt.Errorf("failed to execute version command: %w", err) return string(out), fmt.Errorf("failed to execute version command: %w", err)
} }