tweag / servant-template

A modern template for a Servant
MIT License
53 stars 8 forks source link

ghcid script at bin/api/ghcid #60

Closed mwotton closed 1 year ago

mwotton commented 1 year ago

ghcid makes for a faster feedback loop than stack test --filewatch, so I've added a script locally. Thought it might be useful? I don't know if there's a better way to detect that other nix-ish things have changed that might necessitate a restart, but perhaps this is helpful.

#!/usr/bin/env bash

args=$@
cmd='ghcid --command stack repl servant-template:lib :servant-template-spec
 $args -T :main --restart=package.yaml --restart=stack.yaml'
bin/util/with-nix $cmd
marcosh commented 1 year ago

@cgeorgii what do you say? This looks useful to me

cgeorgii commented 1 year ago

Hey @mwotton and @marcosh. I agree that it's useful to have. Would you mind opening a PR to include it, @mwotton? Thanks!

cgeorgii commented 1 year ago

@mwotton PR #62 introduces a new way of creating tasks/scripts for the project. I included one task task api:dev that would address your issue.

In summary, once this PR is merged you can start a ghcid session like so:

$ task api:dev
[ ... ]
All good (36 modules, at 14:01:59)