@@ -73,6 +73,12 @@ var systems = map[string]string{
73
73
"linuxarm" : "arm-linux-gnueabihf" ,
74
74
}
75
75
76
+ // public vars to allow override in the tests
77
+ var (
78
+ OS = runtime .GOOS
79
+ Arch = runtime .GOARCH
80
+ )
81
+
76
82
func mimeType (data []byte ) (string , error ) {
77
83
return http .DetectContentType (data [0 :512 ]), nil
78
84
}
@@ -321,7 +327,7 @@ func findTool(pack, name, version string, data index) (tool, system) {
321
327
maxSimilarity := 0.7
322
328
323
329
for _ , s := range correctTool .Systems {
324
- similarity := smetrics .Jaro (s .Host , systems [runtime . GOOS + runtime . GOARCH ])
330
+ similarity := smetrics .Jaro (s .Host , systems [OS + Arch ])
325
331
if similarity > maxSimilarity {
326
332
correctSystem = s
327
333
maxSimilarity = similarity
@@ -587,7 +593,7 @@ func (t *Tools) installDrivers(location string) error {
587
593
OkPressed := 6
588
594
extension := ".bat"
589
595
preamble := ""
590
- if runtime . GOOS != "windows" {
596
+ if OS != "windows" {
591
597
extension = ".sh"
592
598
// add ./ to force locality
593
599
preamble = "./"
@@ -599,7 +605,7 @@ func (t *Tools) installDrivers(location string) error {
599
605
os .Chdir (location )
600
606
t .Logger (preamble + "post_install" + extension )
601
607
oscmd := exec .Command (preamble + "post_install" + extension )
602
- if runtime . GOOS != "linux" {
608
+ if OS != "linux" {
603
609
// spawning a shell could be the only way to let the user type his password
604
610
TellCommandNotToSpawnShell (oscmd )
605
611
}
0 commit comments