diff --git a/Dockerfile b/Dockerfile index 5454126..d199b7b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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"] diff --git a/Makefile b/Makefile index 571bcb8..52a24b0 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/cmd/nourybot/commands.go b/commands.go similarity index 100% rename from cmd/nourybot/commands.go rename to commands.go diff --git a/cmd/nourybot/generate.go b/generate.go similarity index 100% rename from cmd/nourybot/generate.go rename to generate.go diff --git a/cmd/nourybot/main.go b/main.go similarity index 87% rename from cmd/nourybot/main.go rename to main.go index bec1452..d9b3e11 100644 --- a/cmd/nourybot/main.go +++ b/main.go @@ -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 } diff --git a/cmd/nourybot/send.go b/send.go similarity index 100% rename from cmd/nourybot/send.go rename to send.go