Last active
February 19, 2016 13:24
-
-
Save alopatindev/ac50981f12956792bb6c to your computer and use it in GitHub Desktop.
Filtered cargo + inotifywait
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# pip2 install toml | |
# wget https://raw.githubusercontent.com/rust-lang/rust/master/src/etc/ctags.rust -O ~/.config/ctags.rust | |
SRCDIR=src | |
RUSTFLAGS="-C target-cpu=core-avx2" | |
#PROJECT="${PWD##*/}" | |
PROJECT=$(python2 -c 'import toml; print toml.loads(file("Cargo.toml").read())["package"]["name"]') | |
exec 2>&1 | |
while inotifywait -r -s -qq -e close_write "${SRCDIR}" | |
do | |
echo | |
echo | |
( | |
cargo test --color always -- --color always 2>>/dev/stdout && | |
# cargo test --color always -- --color always --ignored 2>>/dev/stdout && | |
cargo rustc --color always -- --color always $RUSTFLAGS 2>> /dev/stdout && | |
ctags -f tags --options="$HOME/.config/ctags.rust" --recurse "${SRCDIR}" && | |
rust-gdb -q -ex 'set environment RUST_BACKTRACE=1' -ex r -ex q "target/debug/${PROJECT}" | |
) | egrep -v '(Could not compile |To learn more, run the command again with|^$)' | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment