forked from njhale/gptscript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
49 lines (36 loc) · 1.06 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
.DEFAULT_GOAL := build
all: build-ui build
build-ui:
$(MAKE) -C ui
rm -rf static/ui
mkdir -p static/ui/_nuxt
touch static/ui/placeholder static/ui/_nuxt/_placeholder
cp -rp ui/.output/public/* static/ui/
build-exe:
GOOS=windows go build -o bin/gptscript.exe -tags "${GO_TAGS}" .
build:
CGO_ENABLED=0 go build -o bin/gptscript -tags "${GO_TAGS}" -ldflags "-s -w" .
tidy:
go mod tidy
test:
go test -v ./...
GOLANGCI_LINT_VERSION ?= v1.56.1
lint:
if ! command -v golangci-lint &> /dev/null; then \
echo "Could not find golangci-lint, installing version $(GOLANGCI_LINT_VERSION)."; \
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $$(go env GOPATH)/bin $(GOLANGCI_LINT_VERSION); \
fi
golangci-lint run
validate: tidy lint
if [ -n "$$(git status --porcelain)" ]; then \
git status --porcelain; \
echo "Encountered dirty repo!"; \
git diff; \
exit 1 \
;fi
ci: build
./bin/gptscript ./scripts/ci.gpt
gen-docs: build
./bin/gptscript ./scripts/gen-docs.gpt
serve-docs:
(cd docs && npm i && npm start)