Base default opts
This commit is contained in:
19
hooks/07-add-package-version-suffix-prebuild
Executable file
19
hooks/07-add-package-version-suffix-prebuild
Executable file
@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env bash
|
||||
source "${TAMARIN_UTIL}"
|
||||
|
||||
if [ ! -f debian/changelog ]; then
|
||||
info "No changelog. Skipping..."
|
||||
exit
|
||||
fi
|
||||
|
||||
if [ -d .git ]; then
|
||||
info "It seems to be a Git repository. Generating version suffix based on Git history..."
|
||||
commit_count=$(git rev-list --count HEAD)
|
||||
current_commit=$(git log -n 1 --pretty=format:"%h")
|
||||
version_suffix=tamarin${commit_count}~${current_commit}
|
||||
else
|
||||
info "Not a Git project. Fallback to timestamp for suffix generation..."
|
||||
version_suffix=tamarin$(date +%Y%m%d%H%M)
|
||||
fi
|
||||
|
||||
sed -i "0,/(\(.*\))/s/(\(.*\))/(\1-${version_suffix})/" debian/changelog
|
Reference in New Issue
Block a user