Skip to content

Instantly share code, notes, and snippets.

@jnthn
Created May 6, 2016 16:52
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save jnthn/b29e1628f21e93f2699b3858c79a62af to your computer and use it in GitHub Desktop.
sub MAIN ( Str $app, Str :$w = 'lib,bin') {
my @watchlist = $w.split: /<!after \\> \,/;
s/\\\,/,/ for @watchlist;
say "Attempting to boot up the app";
my $p = bootup-app $app;
react {
whenever watch-recursive @watchlist.grep: *.IO.e -> $e {
say "Change detected [$e.path(), $e.event()]. Restarting app";
$p.kill;
$p = bootup-app $app;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment