Merge pull request #1108 from xushiwei/q

github api: release/asset id => int64
This commit is contained in:
xushiwei
2025-05-12 02:28:34 +08:00
committed by GitHub
2 changed files with 3 additions and 6 deletions

View File

@@ -24,7 +24,7 @@ import (
// ReleaseAsset represents a GitHub release asset.
type ReleaseAsset struct {
URL string `json:"url"` // https://api.github.com/repos/flintlib/flint/releases/assets/242245930
ID int `json:"id"` // 242245930
ID int64 `json:"id"` // 242245930
NodeID string `json:"node_id"` // RA_kwDOAC8YHs4OcGEq
Name string `json:"name"` // flint-3.2.2.tar.gz
ContentType string `json:"content_type"` // application/x-gtar
@@ -38,7 +38,7 @@ type ReleaseAsset struct {
// Release represents a GitHub release.
type Release struct {
URL string `json:"url"` // https://api.github.com/repos/flintlib/flint/releases/209285187
ID int `json:"id"` // 209285187
ID int64 `json:"id"` // 209285187
NodeID string `json:"node_id"` // RE_kwDOAC8YHs4MeXBD
TagName string `json:"tag_name"` // v3.2.2
TargetCommitish string `json:"target_commitish"` // b8223680e38ad048355a421bf7f617bb6c5d5e12

View File

@@ -17,7 +17,6 @@
package cppkg
import (
"fmt"
"os"
"os/exec"
"strings"
@@ -78,14 +77,12 @@ func (p *Tool) Get(quietInstall bool) (app string, err error) {
}
func (p *Tool) getAppManager() (amPath string, install []string, err error) {
var notFoundMgs []string
for _, install = range p.installs {
am := install[0]
if amPath, err = exec.LookPath(am); err == nil {
return
}
notFoundMgs = append(notFoundMgs, am)
}
err = fmt.Errorf("app managers not found: %s: %w", strings.Join(notFoundMgs, ", "), ErrNotFound)
err = ErrNotFound
return
}