option.sh: fix bad check for version/versiondate

i was checking whether it's a directory, whereas i should
have been checking whether it's a file. this is a workaround
put in place in case someone downloaded a tarball from codeberg
which is pre-generated per commit. in this situation, the
version and versiondate files do not exist, but the design
of the build system requires that they do exist.

the existing check is correct except for this bug, so fix
the bug. check that they are files, not directories

Signed-off-by: Leah Rowe <leah@libreboot.org>
20240612_branch
Leah Rowe 2024-05-25 14:37:40 +01:00
parent d32968c731
commit 8da2559b35
1 changed files with 2 additions and 2 deletions

View File

@ -66,9 +66,9 @@ x_() {
[ $# -lt 1 ] || ${@} || $err "Unhandled non-zero exit: $@"; return 0 [ $# -lt 1 ] || ${@} || $err "Unhandled non-zero exit: $@"; return 0
} }
[ -e ".git" ] || [ -d "version" ] || printf "unknown\n" > version || \ [ -e ".git" ] || [ -f "version" ] || printf "unknown\n" > version || \
$err "Cannot generate unknown version file" $err "Cannot generate unknown version file"
[ -e ".git" ] || [ -d "versiondate" ] || printf "1716415872\n" > versiondate || \ [ -e ".git" ] || [ -f "versiondate" ] || printf "1716415872\n" > versiondate || \
$err "Cannot generate unknown versiondate file" $err "Cannot generate unknown versiondate file"
read -r projectname < projectname || : read -r projectname < projectname || :