Skip to content

Commit

Permalink
chore: setup function
Browse files Browse the repository at this point in the history
  • Loading branch information
katallaxie authored Nov 25, 2024
1 parent 3061fcf commit d13f67b
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 16 deletions.
6 changes: 3 additions & 3 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
"ghcr.io/devcontainers/features/go:1": {},
"ghcr.io/zeiss/devcontainer-features/air:1": {},
"ghcr.io/devcontainers/features/github-cli:1": {}
"ghcr.io/devcontainers/features/github-cli:1": {},
"ghcr.io/devcontainers/features/node:1": {}
},
"customizations": {
"vscode": {
Expand All @@ -26,4 +26,4 @@
]
}
}
}
}
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
NAME=
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

# Output of the go coverage tool, specifically when used with LiteIDE
*.out
dist

# Dependency directories (remove the comment below to include it)
# vendor/
Expand All @@ -23,6 +22,8 @@ dist
/vendor/
/Godeps/

.env

### Intellij ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
Expand Down
18 changes: 7 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
.DEFAULT_GOAL := build

-include .env
export

# Go variables
GO ?= go
GO_RUN_TOOLS ?= $(GO) run -modfile ./tools/go.mod
GO_TEST ?= $(GO_RUN_TOOLS) gotest.tools/gotestsum --format pkgname
GO_RELEASER ?= $(GO_RUN_TOOLS) github.com/goreleaser/goreleaser
GO_MOD ?= $(shell ${GO} list -m)

# Air to live reload
AIR ?= air

.PHONY: release
release: ## Release the project.
$(GO_RELEASER) release --clean


.PHONY: build
build: ## Build the binary file.
$(GO_RELEASER) build --snapshot --clean
Expand All @@ -30,9 +26,9 @@ mocks: ## Generate mocks.
fmt: ## Run go fmt against code.
$(GO_RUN_TOOLS) mvdan.cc/gofumpt -w .

.PHONY: start
start: ## Run air live reload. Create a .air.toml file to configure.
$(AIR)
.PHONY: run
run: ## Run the application.
$(GO) run main.go

.PHONY: vet
vet: ## Run go vet against code.
Expand Down
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@ This template supports `Makefile` to run tooling.

> `make` is choosen as it is available on most systems.
## Build

```bash
make
```

Commit the version change and artifacts in the repository.

```bash
git tag -a v1.0.0 -m "Release v1.0.0"
```

## License

[MIT](/LICENSE)
14 changes: 13 additions & 1 deletion shim/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
function chooseBinary() {
if (platform === 'linux' && arch === 'x64') {
return `main-linux-amd64-${VERSION}`
return `main-amd64-linux`
}

if (platform === 'linux' && arch === 'arm64') {
return `main-arm64-linux`
}

if (platform === 'darwin' && arch === 'arm64') {
return `main-arm64-darwin`
}

if (platform === 'darwin' && arch === 'x64') {
return `main-amd64-darwin`
}
}

Expand Down

0 comments on commit d13f67b

Please sign in to comment.