-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9ca89c5
commit fa5d4a4
Showing
6 changed files
with
191 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
tunic.exe | ||
tunic | ||
tmp | ||
*.ova |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
include test.mk | ||
|
||
default: unittest | ||
|
||
tunic.exe: main.go | ||
GOOS=windows GOARCH=amd64 go build -o tunic.exe | ||
|
||
tunic: main.go | ||
GOOS=linux GOARCH=amd64 go build | ||
|
||
# public aliases (phony) | ||
|
||
clean: | ||
go clean | ||
rm -f tunic.exe tunic | ||
|
||
build: tunic.exe tunic | ||
|
||
run: main.go | ||
go run main.go | ||
|
||
all: clean unittest tunic tunic.exe | ||
|
||
#TODO: | ||
# aliases: https://stackoverflow.com/questions/23135840/alias-target-name-in-makefile/33594470#33594470 | ||
# | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package main | ||
|
||
import ( | ||
"log" | ||
"net/http" | ||
"io" | ||
"os" | ||
"os/exec" | ||
) | ||
|
||
/** | ||
* Tunic Linux Installer | ||
* | ||
* This is just something to get us started with very minimal MVP. | ||
* The MVP just downloads the old Tunic and runs it. | ||
*/ | ||
func Download() error { | ||
resp, err := http.Get("https://github.com/mikeslattery/tunic/releases/download/0.2.4/tunic.exe") | ||
if err != nil { | ||
return err | ||
} | ||
defer resp.Body.Close() | ||
|
||
out, err := os.Create("tunic.exe") | ||
if err != nil { | ||
return err | ||
} | ||
defer out.Close() | ||
|
||
_, err = io.Copy(out, resp.Body) | ||
return err | ||
} | ||
|
||
func Run() error { | ||
cmd := exec.Command("tunic.exe") | ||
err := cmd.Run() | ||
return err | ||
} | ||
|
||
func main() { | ||
err := Download() | ||
if err != nil { | ||
err = Run() | ||
} | ||
if err != nil { | ||
log.Fatal(err) | ||
os.Exit(1) | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
download-vm10: | ||
# Found at https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/ | ||
#TODO: https://app.vagrantup.com/Microsoft/boxes/EdgeOnWindows10 | ||
curl -L 'https://az792536.vo.msecnd.net/vms/VMBuild_20190311/VirtualBox/MSEdge/MSEdge.Win10.VirtualBox.zip' | ||
unzip MSEdge.Win10.VirtualBox.zip | ||
rm MSEdge.Win10.VirtualBox.zip | ||
#TODO: create 'MSEdge - Win10.ova' | ||
|
||
unittest: main.go | ||
go test | ||
|
||
loop: | ||
# TODO: recusrive on all source input: .go, resources, images, etc | ||
while :; do inotifywait -qq -r -e create,close_write,modify,move,delete ./ && go test ./...; done | ||
|