Skip to content

Commit

Permalink
Added proper main.go
Browse files Browse the repository at this point in the history
  • Loading branch information
ZerGo0 committed Sep 25, 2024
1 parent 4f17c49 commit 713c552
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ builds:
- linux
- windows
- darwin
main: ./cmd/fontsourcedownloader/main.go
main: ./main.go

archives:
- format: tar.gz
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ FROM base AS build
RUN --mount=target=. \
--mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
go build -ldflags="-w -s" -o /app/main ./cmd/fontsourcedownloader/*.go
go build -ldflags="-w -s" -o /app/main ./main.go

# Import the binary from build stage

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ fmt: ## Formats all code with go fmt
@go fmt ./...

run: fmt ## Run the app
@go run ./cmd/fontsourcedownloader/main.go $(ARGS)
@go run ./main.go $(ARGS)

test-build: ## Tests whether the code compiles
@go build -o /dev/null ./...
Expand Down
Empty file removed api/openapi.v1.yml
Empty file.
4 changes: 2 additions & 2 deletions cmd/fontsourcedownloader/main.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package cmd

import (
"context"
Expand All @@ -15,7 +15,7 @@ import (
"github.com/zergo0/fontsourcedownloader/pkg/services/fontsource"
)

func main() {
func Execute() {
outputDir := flag.String("out", "", "output directory")
formats := flag.String("formats", "woff2,woff", "font formats comma separated")
weights := flag.String("weights", "400", "font weights comma separated")
Expand Down
9 changes: 9 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package main

import (
cmd "github.com/zergo0/fontsourcedownloader/cmd/fontsourcedownloader"
)

func main() {
cmd.Execute()
}
3 changes: 0 additions & 3 deletions pkg/README.md

This file was deleted.

0 comments on commit 713c552

Please sign in to comment.