Fixed repositoryMap, added listing packages, added a makefile (forward... ported?) from httpserver
This commit is contained in:
parent
64d4174edd
commit
b329a7ba52
2 changed files with 66 additions and 0 deletions
23
Makefile
Normal file
23
Makefile
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
DESTDIR ?= /usr
|
||||||
|
BUILDDIR ?= dist
|
||||||
|
CGO_ENABLED ?= 0
|
||||||
|
|
||||||
|
all: cmd
|
||||||
|
|
||||||
|
cmd ./cmd/eon/main.go:
|
||||||
|
mkdir -p $(BUILDDIR)/bin
|
||||||
|
go build -o $(BUILDDIR)/bin/eon ./cmd/eon -ldflags "-s -w"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
install:
|
||||||
|
install -d $(DESTDIR)/bin
|
||||||
|
install -m 755 $(BUILDDIR)/bin/eon $(DESTDIR)/bin/burgerbackup-client
|
||||||
|
|
||||||
|
uninstall:
|
||||||
|
rm -f $(DESTDIR)/bin/eon
|
||||||
|
|
||||||
|
test:
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -rf $(BUILDDIR)
|
43
main.go
Normal file
43
main.go
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
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)
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue