summaryrefslogtreecommitdiffstats
path: root/tui/exec_windows.go
diff options
context:
space:
mode:
authorRashil Gandhi <rashil2000@gmail.com>2021-08-24 00:09:18 +0530
committerDaniel Milde <daniel@milde.cz>2021-08-23 22:58:47 +0200
commit4116f817f9502a0bafefba683654becd76abe305 (patch)
treeec566533b3e846a3fbb758d42b4ce951c6a9261c /tui/exec_windows.go
parent1ad2c9dfa112c4cbab52634ffc8224db62788368 (diff)
Use conditional compilation
Diffstat (limited to 'tui/exec_windows.go')
-rw-r--r--tui/exec_windows.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/tui/exec_windows.go b/tui/exec_windows.go
new file mode 100644
index 0000000..f0bbdcb
--- /dev/null
+++ b/tui/exec_windows.go
@@ -0,0 +1,20 @@
+package tui
+
+import (
+ "os"
+ "os/exec"
+)
+
+func Execute(argv0 string, argv []string, envv []string) error {
+ // Windows does not support exec syscall.
+ cmd := exec.Command(argv0, argv...)
+ cmd.Stdout = os.Stdout
+ cmd.Stderr = os.Stderr
+ cmd.Stdin = os.Stdin
+ cmd.Env = envv
+ err := cmd.Run()
+ if err == nil {
+ os.Exit(0)
+ }
+ return err
+}