Skip to content

Commit 0372d93

Browse files
committed
Fix Linux post_install.sh
1 parent bcd90ce commit 0372d93

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tools/download.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -448,16 +448,19 @@ func extractTarGz(body []byte, location string) (string, error) {
448448
func (t *Tools) installDrivers(location string) error {
449449
OK_PRESSED := 6
450450
extension := ".bat"
451+
preamble := ""
451452
if runtime.GOOS != "windows" {
452453
extension = ".sh"
454+
// add ./ to force locality
455+
preamble = "./"
453456
}
454457
if _, err := os.Stat(filepath.Join(location, "post_install"+extension)); err == nil {
455458
t.Logger.Println("Installing drivers")
456459
ok := MessageBox("Installing drivers", "We are about to install some drivers needed to use Arduino/Genuino boards\nDo you want to continue?")
457460
t.Logger.Println(ok)
458461
if ok == OK_PRESSED {
459462
os.Chdir(location)
460-
oscmd := exec.Command("post_install" + extension)
463+
oscmd := exec.Command(preamble + "post_install" + extension)
461464
if runtime.GOOS != "linux" {
462465
// spawning a shell could be the only way to let the user type his password
463466
TellCommandNotToSpawnShell(oscmd)

0 commit comments

Comments
 (0)