• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/bash
2# Add hooks to git.
3
4set -e
5
6# Change to our project home.
7script_dir=`dirname "${BASH_SOURCE[0]}"`
8cd "$script_dir"/..
9
10# Install formatting hook.
11echo 'echo "Running rustfmt and clippy checks."' > .git/hooks/pre-commit
12echo "scripts/check.sh" >> .git/hooks/pre-commit
13echo 'echo "Running linter checks."' > .git/hooks/pre-commit
14echo 'RUSTFLAGS="--deny warnings" cargo +nightly build --features=lint' >> .git/hooks/pre-commit
15chmod +x .git/hooks/pre-commit
16