# Trigger: small utility to restart your app on recompile

**URL:** <https://discourse.haskell.org/t/trigger-small-utility-to-restart-your-app-on-recompile/452>\
**Category:** Show and Tell\
**Created:** [March 11, 2019, 5:59pm UTC](https://discourse.haskell.org/t/trigger-small-utility-to-restart-your-app-on-recompile/452 "2019-03-11T17:59:21Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![k-bx](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/k-bx/32/167_2.png) [@k-bx](https://discourse.haskell.org/u/k-bx)\
**Post date:** [March 11, 2019, 5:59pm UTC](https://discourse.haskell.org/t/trigger-small-utility-to-restart-your-app-on-recompile/452/1 "2019-03-11T17:59:22Z")

</div>

Hi. I’ve made a small utility that’s handy to automatically restart your app once its executable changed: [https://github.com/k-bx/trigger](https://github.com/k-bx/trigger)

It’s in “alpha” stage, but should be good enough to get some feedback and maybe gather alternatives that I couldn’t find.

Thanks!

---

<div class="post-metadata">

**Author:** ![wizzup](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/wizzup/32/341_2.png) [@wizzup](https://discourse.haskell.org/u/wizzup)\
**Post date:** [March 11, 2019, 10:28pm UTC](https://discourse.haskell.org/t/trigger-small-utility-to-restart-your-app-on-recompile/452/2 "2019-03-11T22:28:32Z")

</div>

Looking good for a specific usecase. Your target is watching only single executable file right?

I use [steel overseer](https://github.com/schell/steeloverseer) for similar job but I have to write wrapper script to kill and respawn the target myself.

You might want to looking for the same file pattern matching to extends usage spectrum of your tool (in case you want to do).

---

<div class="post-metadata">

**Author:** ![k-bx](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/k-bx/32/167_2.png) [@k-bx](https://discourse.haskell.org/u/k-bx)\
**Post date:** [March 12, 2019, 6:15am UTC](https://discourse.haskell.org/t/trigger-small-utility-to-restart-your-app-on-recompile/452/3 "2019-03-12T06:15:35Z")

</div>

Currently (and default behavior) yes, but next step is to replace this script also (plus making it cross platform) [https://gitlab.com/k-bx/meetup/blob/master/run-dev.sh](https://gitlab.com/k-bx/meetup/blob/master/run-dev.sh)

---

<div class="post-metadata">

**Author:** ![k-bx](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/k-bx/32/167_2.png) [@k-bx](https://discourse.haskell.org/u/k-bx)\
**Post date:** [March 12, 2019, 6:30am UTC](https://discourse.haskell.org/t/trigger-small-utility-to-restart-your-app-on-recompile/452/4 "2019-03-12T06:30:57Z")

</div>

Thinking about using DHall to describe a matching function btw

---

<div class="post-metadata">

**Author:** ![jaspervdj](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/jaspervdj/32/586_2.png) [@jaspervdj](https://discourse.haskell.org/u/jaspervdj)\
**Post date:** [March 12, 2019, 9:55am UTC](https://discourse.haskell.org/t/trigger-small-utility-to-restart-your-app-on-recompile/452/5 "2019-03-12T09:55:58Z")

</div>

That’s awesome – I like the idea of using DHall, but the current zero-configuration style is also very nice, it just does what it’s supposed to do.

---

<div class="post-metadata">

**Author:** ![ChShersh](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/chshersh/32/2551_2.png) [@ChShersh](https://discourse.haskell.org/u/ChShersh)\
**Post date:** [March 13, 2019, 1:54am UTC](https://discourse.haskell.org/t/trigger-small-utility-to-restart-your-app-on-recompile/452/6 "2019-03-13T01:54:13Z")

</div>

There already exist one `trigger` for restart workflows:

- [https://github.com/rhyskeepence/trigger](https://github.com/rhyskeepence/trigger)

I wonder, how it compares 🤔

---

<div class="post-metadata">

**Author:** ![k-bx](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/k-bx/32/167_2.png) [@k-bx](https://discourse.haskell.org/u/k-bx)\
**Post date:** [March 13, 2019, 7:19am UTC](https://discourse.haskell.org/t/trigger-small-utility-to-restart-your-app-on-recompile/452/7 "2019-03-13T07:19:50Z")

</div>

Nice! Still want to make the DHall configuration (started checking it out), plus I like the default behavior of my app (point to executable, zero-config).

---

<div class="post-metadata">

**Author:** ![absolutelyproprietar](https://avatars.discourse-cdn.com/v4/letter/a/ecb155/32.png) [@absolutelyproprietar](https://discourse.haskell.org/u/absolutelyproprietar)\
**Post date:** [April 16, 2019, 1:37am UTC](https://discourse.haskell.org/t/trigger-small-utility-to-restart-your-app-on-recompile/452/8 "2019-04-16T01:37:10Z")

</div>

I wish stack would do this also with --file-watch
