Added precompiled binaries
This commit is contained in:
parent
3ca7e8588a
commit
8be8069ec0
2
compileServices.sh
Executable file
2
compileServices.sh
Executable file
@ -0,0 +1,2 @@
|
|||||||
|
GOOS=windows go generate ./services
|
||||||
|
GOOS=linux go generate ./services
|
||||||
6
main.go
6
main.go
@ -16,11 +16,11 @@ import (
|
|||||||
func main() {
|
func main() {
|
||||||
conf, err := common.ReadConfig()
|
conf, err := common.ReadConfig()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
slog.Error(err.Error())
|
||||||
|
} else {
|
||||||
|
setLogLevel(conf)
|
||||||
}
|
}
|
||||||
|
|
||||||
setLogLevel(conf)
|
|
||||||
|
|
||||||
app := &cli.Command{
|
app := &cli.Command{
|
||||||
Name: "KleinCommand",
|
Name: "KleinCommand",
|
||||||
Usage: "CLI tool for internal use",
|
Usage: "CLI tool for internal use",
|
||||||
|
|||||||
BIN
services/exampleService
Executable file
BIN
services/exampleService
Executable file
Binary file not shown.
BIN
services/exampleService.exe
Executable file
BIN
services/exampleService.exe
Executable file
Binary file not shown.
@ -4,7 +4,12 @@ package services
|
|||||||
|
|
||||||
//go:generate go build ./example
|
//go:generate go build ./example
|
||||||
|
|
||||||
import _ "embed"
|
import (
|
||||||
|
_ "embed"
|
||||||
|
"os"
|
||||||
|
"os/exec"
|
||||||
|
"syscall"
|
||||||
|
)
|
||||||
|
|
||||||
//go:embed exampleService
|
//go:embed exampleService
|
||||||
var exampleService []byte
|
var exampleService []byte
|
||||||
|
|||||||
@ -15,7 +15,8 @@ import (
|
|||||||
var exampleService []byte
|
var exampleService []byte
|
||||||
|
|
||||||
func runService(name string, file []byte) error {
|
func runService(name string, file []byte) error {
|
||||||
tempFile, err := os.CreateTemp("", name)
|
executableName := name + ".exe"
|
||||||
|
tempFile, err := os.CreateTemp("", executableName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user