This repository was archived by the owner on Dec 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
57 lines (45 loc) · 1.88 KB
/
Copy pathMakefile
File metadata and controls
57 lines (45 loc) · 1.88 KB
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
50
51
52
53
54
55
56
57
# ==================================================================================== #
# HELPERS
# ==================================================================================== #
## help: print this help message
.PHONY: help
help:
@echo 'Usage:'
@sed -n 's/^##//p' ${MAKEFILE_LIST} | column -t -s ':' | sed -e 's/^/ /'
# ==================================================================================== #
# QUALITY CONTROL
# ==================================================================================== #
## tidy: format code and tidy modfile
.PHONY: tidy
tidy:
go fmt ./...
go mod tidy -v
## audit: run quality control checks
.PHONY: audit
audit:
go vet ./...
go run honnef.co/go/tools/cmd/staticcheck@latest -checks=all,-ST1000,-U1000 ./...
go test -race -vet=off ./...
go mod verify
# ==================================================================================== #
# CSS
# ==================================================================================== #
## css/generate: generate bulma based css
.PHONY: css/generate
css/generate:
npm run css-build
# ==================================================================================== #
# DB
# ==================================================================================== #
.PHONY: db/createSessionsTable
db/createSessionsTable:
sqlite3 liberator.db "drop index if exists sessions_expiry_idx" "drop table if exists sessions" "CREATE TABLE sessions (token TEXT PRIMARY KEY,data BLOB NOT NULL,expiry REAL NOT NULL);" "CREATE INDEX idx_sessions_expiry ON sessions(expiry);" ".exit"
.PHONY: db/clearSessions
db/clearSessions:
sqlite3 liberator.db "DELETE FROM sessions;" ".exit"
# ==================================================================================== #
# App
# ==================================================================================== #
.PHONY: run
run:
go run ./cmd/web -port=5000