From b8ec7d56404481c6917107f980e8ff90aaf13781 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Fri, 24 May 2024 14:53:45 +0100 Subject: [PATCH] option.sh: generate version file if .git not found a user was getting error "version unset" when using the tarball generated from codeberg. it's recommended to use the git repository properly, or a release archive. mitigate this so that the build succeeds anyway. Signed-off-by: Leah Rowe --- include/option.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/option.sh b/include/option.sh index bfeb9eb3..3648ecd2 100755 --- a/include/option.sh +++ b/include/option.sh @@ -66,6 +66,11 @@ x_() { [ $# -lt 1 ] || ${@} || $err "Unhandled non-zero exit: $@"; return 0 } +[ -e ".git" ] || [ -d "version" ] || printf "unknown\n" > version || \ + $err "Cannot generate unknown version file" +[ -e ".git" ] || [ -d "versiondate" ] || printf "1716415872\n" > versiondate || \ + $err "Cannot generate unknown versiondate file" + read -r projectname < projectname || : [ ! -f version ] || read -r version < version || : version_="${version}"