Skip to content

Commit 416bb94

Browse files
committed
Fix post_install action
1 parent 0506220 commit 416bb94

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

tools/download.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,7 @@ func extractTarGz(body []byte, location string) (string, error) {
446446
}
447447

448448
func (t *Tools) installDrivers(location string) error {
449+
OK_PRESSED := 6
449450
extension := ".bat"
450451
if runtime.GOOS != "windows" {
451452
extension = ".sh"
@@ -454,9 +455,9 @@ func (t *Tools) installDrivers(location string) error {
454455
t.Logger.Println("Installing drivers")
455456
ok := MessageBox("Installing drivers", "We are about to install some drivers needed to use Arduino/Genuino boards\nDo you want to continue?")
456457
t.Logger.Println(ok)
457-
if ok == 6 {
458+
if ok == OK_PRESSED {
458459
os.Chdir(location)
459-
oscmd := exec.Command("post_install.bat")
460+
oscmd := exec.Command("post_install"+extension)
460461
if runtime.GOOS != "linux" {
461462
// spawning a shell could be the only way to let the user type his password
462463
TellCommandNotToSpawnShell(oscmd)

tools/hidefile_darwin.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ func TellCommandNotToSpawnShell(_ *exec.Cmd) {
1212
}
1313

1414
func MessageBox(title, text string) int {
15-
return 0
15+
return 6
1616
}

tools/hidefile_linux.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ func TellCommandNotToSpawnShell(_ *exec.Cmd) {
1212
}
1313

1414
func MessageBox(title, text string) int {
15-
return 0
15+
return 6
1616
}

0 commit comments

Comments
 (0)