mirror of
https://github.com/unisonweb/unison.git
synced 2024-10-05 14:17:33 +03:00
d2399a46d1
continue watching for changes even if initial haskell build fails
28 lines
648 B
Bash
Executable File
28 lines
648 B
Bash
Executable File
#!/usr/bin/env bash
|
|
source="$1"
|
|
if [ -z "$source" ]; then
|
|
echo "usage: $0 <file.u>"
|
|
exit 1
|
|
fi
|
|
|
|
assert_command_exists () {
|
|
if ! ( type "$1" &> /dev/null ); then
|
|
echo "Sorry, I need the '$1' command, but couldn't find it installed." >&2
|
|
exit 1
|
|
fi
|
|
}
|
|
|
|
assert_command_exists mktemp
|
|
assert_command_exists stack
|
|
assert_command_exists sbt
|
|
assert_command_exists scala
|
|
assert_command_exists fswatch
|
|
|
|
echo "Building parser/typechecker..." && \
|
|
stack build && \
|
|
echo "Building runtime..." && \
|
|
(cd runtime-jvm; sbt main/compile) && \
|
|
"`dirname $0`/exec.sh" "$source"
|
|
|
|
fswatch "$source" . | xargs -n1 "`dirname $0`/exec2.sh" "$source"
|