added cargo build post-merge hook

This commit is contained in:
Emma Tebibyte 2023-01-13 11:34:19 -05:00
commit 8f6929758b
2 changed files with 18 additions and 0 deletions

4
README.md Normal file
View File

@ -0,0 +1,4 @@
# git hooks
All of the files in this repository are licensed under the [GNU All-Permissive
License](https://www.gnu.org/prep/maintain/html_node/License-Notices-for-Other-Files.html)

14
post-merge/cargo-build Executable file
View File

@ -0,0 +1,14 @@
#!/bin/sh
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice and this
# notice are preserved. This file is offered as-is, without any warranty.
# Hook to compile Rust source files when they have been changed.
for file in \
$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD |\
sed -n -e 's/src\///' -e 's/\.rs//p')
do
cargo build --release --bin "$file"
done