Skip to content

Commit 009369a

Browse files
authored
chore: detect if it is arm64 (#318)
1 parent 71c587a commit 009369a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

cmd/get.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package cmd
33
import (
44
"context"
55
"fmt"
6+
"internal/goarch"
67
"net/http"
78
"net/url"
89
sysos "os"
@@ -127,11 +128,22 @@ func (o *downloadOption) fetch() (err error) {
127128
return
128129
}
129130

131+
func (o *downloadOption) archFix() {
132+
if o.Arch != "arm" {
133+
return
134+
}
135+
136+
if goarch.IsArm64 == 1 {
137+
o.Arch = "arm64"
138+
}
139+
}
140+
130141
func (o *downloadOption) preRunE(cmd *cobra.Command, args []string) (err error) {
131142
// this might not be the best way to print schema
132143
if o.PrintSchema {
133144
return
134145
}
146+
o.archFix()
135147

136148
if err = o.fetch(); err != nil {
137149
return

0 commit comments

Comments
 (0)