Skip to content

Instantly share code, notes, and snippets.

@nielsbom
Last active November 14, 2018 13:17
Show Gist options
  • Save nielsbom/87e2e936576baea0440b4e715863f201 to your computer and use it in GitHub Desktop.
Save nielsbom/87e2e936576baea0440b4e715863f201 to your computer and use it in GitHub Desktop.
Shell script to init a Reason/ReasonML project, autocompile and autorun on change
# Dependencies:
# - Bucklescript: https://bucklescript.github.io/en/
# - entr for watching file changes: http://entrproject.org/
# Source this file in your bashrc (or other shell) to have the command available
# Set your $EDITOR environment variable to the editor of your choice.
# To use: $ reasonstart my-new-project
# This will create and start the new project on the given location.
function reasonstart () {
bsb -init $1 -theme basic-reason &&
cd $1 &&
$EDITOR ./src/*re &&
find src/*re | entr sh -c 'npm run build && node src/Demo.bs.js'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment