Skip to content

Instantly share code, notes, and snippets.

@joakin
Last active July 25, 2023 11:20
Show Gist options
  • Save joakin/3c4c32d591d1cf902276fc37fcd23ca6 to your computer and use it in GitHub Desktop.
Save joakin/3c4c32d591d1cf902276fc37fcd23ca6 to your computer and use it in GitHub Desktop.
Watch and compile elm files
#!/usr/bin/env bash
COLOR_OFF="\e[0m";
DIM="\e[2m";
function compile {
# Customize the elm make command as needed
elm make src/elm/Main.elm src/elm/Stories/**/*.elm && rm elm.js
}
function run {
clear;
tput reset;
echo -en "\033c\033[3J";
echo -en "${DIM}";
date -R;
echo -en "${COLOR_OFF}";
compile;
}
run;
chokidar src | while read WHATEVER; do
run;
done;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment