Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b63f084

Browse files
committed
Hardcode database path
1 parent 5d02d1e commit b63f084

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

Makefile

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
INSTALL_DIR=$(shell go env GOPATH)/bin
22
GOOS=$(shell go env GOOS)
33
GOARCH=$(shell go env GOARCH)
4-
DATABASE_DIR=coderd/database
54

65
bin:
76
goreleaser build --snapshot --rm-dist
@@ -11,14 +10,14 @@ build: site/out bin
1110
.PHONY: build
1211

1312
# Runs migrations to output a dump of the database.
14-
$(DATABASE_DIR)/dump.sql: $(wildcard database/migrations/*.sql)
15-
go run $(DATABASE_DIR)/dump/main.go
13+
coderd/database/dump.sql: $(wildcard coderd/database/migrations/*.sql)
14+
go run coderd/database/dump/main.go
1615

1716
# Generates Go code for querying the database.
18-
database/generate: fmt/sql $(DATABASE_DIR)/dump.sql $(DATABASE_DIR)/query.sql
19-
cd $(DATABASE_DIR) && sqlc generate && rm db_tmp.go
20-
cd $(DATABASE_DIR) && gofmt -w -r 'Querier -> querier' *.go
21-
cd $(DATABASE_DIR) && gofmt -w -r 'Queries -> sqlQuerier' *.go
17+
database/generate: fmt/sql coderd/database/dump.sql coderd/database/query.sql
18+
cd coderd/database && sqlc generate && rm db_tmp.go
19+
cd coderd/database && gofmt -w -r 'Querier -> querier' *.go
20+
cd coderd/database && gofmt -w -r 'Queries -> sqlQuerier' *.go
2221
.PHONY: database/generate
2322

2423
fmt/prettier:
@@ -31,13 +30,13 @@ else
3130
endif
3231
.PHONY: fmt/prettier
3332

34-
fmt/sql: ./$(DATABASE_DIR)/query.sql
33+
fmt/sql: ./coderd/database/query.sql
3534
npx sql-formatter \
3635
--language postgresql \
3736
--lines-between-queries 2 \
38-
./$(DATABASE_DIR)/query.sql \
39-
--output ./$(DATABASE_DIR)/query.sql
40-
sed -i 's/@ /@/g' ./$(DATABASE_DIR)/query.sql
37+
./coderd/database/query.sql \
38+
--output ./coderd/database/query.sql
39+
sed -i 's/@ /@/g' ./coderd/database/query.sql
4140

4241
fmt: fmt/prettier fmt/sql
4342
.PHONY: fmt

0 commit comments

Comments
 (0)