This commit is contained in:
lyx0 2024-03-05 18:54:38 +01:00
parent 6f81209e91
commit 15ac5f523a
6 changed files with 10 additions and 27 deletions

View file

@ -17,7 +17,7 @@ COPY .env .
RUN go get -d -v ./...
# Build the Go app
RUN go build ./cmd/nourybot
RUN go build -o Nourybot.out .
# Run the executable
CMD [ "./nourybot"]
CMD [ "./Nourybot.out"]

View file

@ -1,18 +1,17 @@
BINARY_NAME=Nourybot.out
BINARY_NAME_API=NourybotApi.out
build:
go get -d -v ./...
go build -o Nourybot.out .
run:
./Nourybot.out
up:
docker compose up
down:
docker compose down
docker compose build
docker compose up
rebuild:
docker compose down
docker compose build
docker compose up -d
xd:
docker compose down
docker compose build
docker compose up

View file

@ -1,11 +1,7 @@
package main
import (
"context"
"fmt"
"io"
"os"
"os/signal"
"github.com/gempir/go-twitch-irc/v4"
"github.com/joho/godotenv"
@ -28,16 +24,6 @@ type application struct {
}
func main() {
ctx := context.Background()
ctx, cancel := signal.NotifyContext(ctx, os.Interrupt)
defer cancel()
if err := run(ctx, os.Stdout, os.Args); err != nil {
fmt.Fprintf(os.Stderr, "%s\n", err)
os.Exit(1)
}
}
func run(ctx context.Context, w io.Writer, args []string) error {
var cfg config
logger := zap.NewExample()
@ -106,6 +92,4 @@ func run(ctx context.Context, w io.Writer, args []string) error {
if err != nil {
panic(err)
}
return nil
}