eon/main.go

43 lines
1.5 KiB
Go

package main
import (
"fmt"
"os"
"os/exec"
)
// Hello, fellow programmer! This is a warning script.
// It is meant for idiots who don't read the README.md file.
// If you are reading this, you are probably one of those idiots.
// Please use the Makefile to build eon.
// If you are trying to contribute to eon, then start by reading the README.md file.
// That might have a teensy weensy bit of useful information.
// ;) Have a great day (unless you are using this script in production).
func main() {
fmt.Println("[WARN] This isn't how you are meant to build eon. Please use the Makefile.")
fmt.Println("[INFO] This script only exists as a warning and so go test has something to run.")
fmt.Print("[PROMPT] Would you like me to run the makefile for you? (y/n): ")
var input string
_, err := fmt.Scanln(&input)
if err != nil {
fmt.Println("[FATAL] Error reading input: " + err.Error())
os.Exit(1)
}
if input == "y" {
fmt.Println("[INFO] Running make... (you should use the Makefile, this isn't how you are meant to build eon)")
err := exec.Command("make").Run()
if err != nil {
fmt.Println("[FATAL] Error running make: " + err.Error())
os.Exit(1)
} else {
fmt.Println("[INFO] Shame on you for not using the Makefile.")
fmt.Println("[INFO] If you use this idiotic script in production, don't.")
}
} else {
fmt.Println("[INFO] Shame on you for not using the Makefile.")
fmt.Println("[INFO] If you use this idiotic script in production, don't.")
os.Exit(1)
}
}