mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-14 17:02:49 +03:00
tooling: add make ghcid commands
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5097 GitOrigin-RevId: 2463c61afbffedaaf21bdd3a014f79f1cc4b930e
This commit is contained in:
parent
38a10bebb7
commit
1375a77fd7
1
Makefile
1
Makefile
@ -8,3 +8,4 @@ help:
|
|||||||
include ./scripts/make/tests.mk
|
include ./scripts/make/tests.mk
|
||||||
include ./scripts/make/lint.mk
|
include ./scripts/make/lint.mk
|
||||||
include ./scripts/make/build.mk
|
include ./scripts/make/build.mk
|
||||||
|
include ./scripts/make/ghcid.mk
|
||||||
|
23
scripts/make/ghcid.mk
Normal file
23
scripts/make/ghcid.mk
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
GHCID_FLAGS = --builddir ./dist-newstyle/repl --repl-option -O0 --repl-option -fobject-code
|
||||||
|
PANE_WIDTH = $(shell tmux display -p "\#{pane_width}" || echo 80)
|
||||||
|
PANE_HEIGHT = $(shell tmux display -p "\#{pane_height}" || echo 30 )
|
||||||
|
|
||||||
|
|
||||||
|
define run_ghcid
|
||||||
|
@if [[ $$(uname -p) == 'arm' ]]; then \
|
||||||
|
ghcid -c "cabal repl $(1) $(GHCID_FLAGS)" --width=$(PANE_WIDTH) --height=$(PANE_HEIGHT); \
|
||||||
|
else \
|
||||||
|
ghcid -c "cabal repl $(1) $(GHCID_FLAGS)"; \
|
||||||
|
fi
|
||||||
|
endef
|
||||||
|
|
||||||
|
.PHONY: ghcid-library
|
||||||
|
## ghcid-library: build and watch library in ghcid
|
||||||
|
ghcid-library:
|
||||||
|
$(call run_ghcid,graphql-engine:lib:graphql-engine)
|
||||||
|
|
||||||
|
.PHONY: ghcid-hspec
|
||||||
|
## ghcid-hspec: build and watch tests-hspec in ghcid
|
||||||
|
ghcid-hspec:
|
||||||
|
$(call run_ghcid,graphql-engine:tests-hspec)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user