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,6 +14,8 @@ import (
14 14
 	"os/signal"
15 15
 	"path/filepath"
16 16
 
17
+	"runtime"
18
+
17 19
 	"github.com/fsnotify/fsnotify"
18 20
 )
19 21
 
@@ -30,11 +32,18 @@ func buildGopherJSProject() {
30 32
 			log.Fatal("Encountered an error while attempting to get the cwd: ", err)
31 33
 		} else {
32 34
 			os.Chdir(gopherjsAppPath)
35
+
33 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 42
 			gjsCommand.Stdout = os.Stdout
35 43
 			gjsCommand.Stderr = os.Stderr
36 44
 			gjsCommand.Start()
37 45
 			os.Chdir(cwd)
46
+
38 47
 		}
39 48
 	}
40 49