Tamarin/hooks/prebuild/debian/complete-project-db

14 lines
469 B
Bash
Executable File

#!/usr/bin/env bash
cd src
if [ -z "$(tamarin_db get project_name)" ]; then
if [ ! -d ".git" ]; then
tamarin_error "This project is not managed with Git ! Cannot extract the project's name without it !"
exit 1
fi
project_name=$(basename $(git config --get remote.origin.url) | sed 's/.git$//' | tr '[:upper:]' '[:lower:]')
tamarin_info "Extracted project name from Git metadata: \"${project_name}\""
tamarin_db set project_name "${project_name}"
fi