Update build configuration files

This commit is contained in:
Oliver Davies 2024-01-31 09:12:51 +00:00
parent eb3273a53b
commit 4b88591283
2 changed files with 30 additions and 1 deletions

27
.githooks/prepare-commit-msg Executable file
View file

@ -0,0 +1,27 @@
#!/usr/bin/env bash
# Do not edit this file. It is automatically generated by https://www.oliverdavies.uk/build-configs.
# Load the issue ID from an `.issue-id` file within the project and replace the
# `ISSUE_ID` placeholder within a Git commit message.
#
# For example, running `echo "OD-123" > .issue-id` will add `Refs: OD-123` to
# the commit message.
#
# This also works with multiple issue IDs in the same string, e.g.
# "OD-123 OD-456", or IDs on multiple lines.
set -o errexit
set -o nounset
set -o pipefail
PROJECT_DIR=$(git rev-parse --show-toplevel)
ISSUE_FILE="$PROJECT_DIR/.issue-id"
if [ -f "${ISSUE_FILE}" ]; then
ISSUE_IDS=$(cat "${ISSUE_FILE}" | tr '\n' ',' | tr ' ' ',' | sed 's/,$//' | sed 's/,/, /g')
if [ -n "${ISSUE_IDS}" ]; then
sed -i.bak "s/# Refs:/Refs: $ISSUE_IDS/" "$1"
fi
fi

4
run
View file

@ -1,5 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Do not edit this file. It is automatically generated by https://www.oliverdavies.uk/build-configs.
set -o errexit set -o errexit
set -o nounset set -o nounset
set -o pipefail set -o pipefail
@ -16,7 +18,7 @@ function generate {
args=(--server --watch) args=(--server --watch)
fi fi
sculpin generate "${args[@]}" sculpin generate "${args[@]}" "${@}"
} }
function help { function help {