Browse Source

Added workaround for Windows GopherJS 1.9-1 issue.

Wirecog 6 years ago
parent
commit
52655d09cc
1 changed files with 9 additions and 0 deletions
  1. 9
    0
      kick.go

+ 9
- 0
kick.go View File

14
 	"os/signal"
14
 	"os/signal"
15
 	"path/filepath"
15
 	"path/filepath"
16
 
16
 
17
+	"runtime"
18
+
17
 	"github.com/fsnotify/fsnotify"
19
 	"github.com/fsnotify/fsnotify"
18
 )
20
 )
19
 
21
 
30
 			log.Fatal("Encountered an error while attempting to get the cwd: ", err)
32
 			log.Fatal("Encountered an error while attempting to get the cwd: ", err)
31
 		} else {
33
 		} else {
32
 			os.Chdir(gopherjsAppPath)
34
 			os.Chdir(gopherjsAppPath)
35
+
33
 			gjsCommand := exec.Command("gopherjs", "build")
36
 			gjsCommand := exec.Command("gopherjs", "build")
37
+			if runtime.GOOS == "windows" {
38
+				// workaround as described here: https://github.com/gopherjs/gopherjs/issues/688
39
+
40
+				gjsCommand.Env = append(os.Environ(), "GOOS=darwin")
41
+			}
34
 			gjsCommand.Stdout = os.Stdout
42
 			gjsCommand.Stdout = os.Stdout
35
 			gjsCommand.Stderr = os.Stderr
43
 			gjsCommand.Stderr = os.Stderr
36
 			gjsCommand.Start()
44
 			gjsCommand.Start()
37
 			os.Chdir(cwd)
45
 			os.Chdir(cwd)
46
+
38
 		}
47
 		}
39
 	}
48
 	}
40
 
49