#!/bin/sh
#
# This script is meant to be used in rust projects via `cargo flow [PATH..]`
# and then running `:cf` in vim to load the errors (if any) into Quickfix.
#

# Remove the "flow" argument.
shift

cmd="flow-check $@"

# Exec cargo-watch with `flow-check`
exec cargo watch -qc -i 'target/*' -i errors.err -x "$cmd"
