Skip to content

Instantly share code, notes, and snippets.

@r0xsh
Created March 10, 2017 15:09
Show Gist options
  • Save r0xsh/46b80d60425a3eb9a4b0f50084e29fd8 to your computer and use it in GitHub Desktop.
Save r0xsh/46b80d60425a3eb9a4b0f50084e29fd8 to your computer and use it in GitHub Desktop.
Git hook, run Rust lang unit test
#!/bin/sh
REPO_NAME=papers_database
GIT_DIR=$HOME/$REPO_NAME.git
WORK_DIR=$HOME/work/$REPO_NAME
mkdir -p $WORK_DIR
git --work-tree=$WORK_DIR --git-dir=$GIT_DIR checkout -f
cd $WORK_DIR
export PATH="$HOME/.cargo/bin:$PATH"
cargo test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment