From 8f6929758bbd88361376e62e1a1dae6f6177acae Mon Sep 17 00:00:00 2001 From: emma Date: Fri, 13 Jan 2023 11:34:19 -0500 Subject: [PATCH] added cargo build post-merge hook --- README.md | 4 ++++ post-merge/cargo-build | 14 ++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 README.md create mode 100755 post-merge/cargo-build diff --git a/README.md b/README.md new file mode 100644 index 0000000..41d4f15 --- /dev/null +++ b/README.md @@ -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) diff --git a/post-merge/cargo-build b/post-merge/cargo-build new file mode 100755 index 0000000..d3f10cc --- /dev/null +++ b/post-merge/cargo-build @@ -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