do not continue if there is no git log for the EN base file

This commit is contained in:
Max Mehl 2019-10-02 14:59:22 +02:00
rodzic 0b6f8d5b08
commit bb5466ecd1
Podpisane przez: max.mehl
ID klucza GPG: 2704E4AB371E2E92
1 zmienionych plików z 7 dodań i 0 usunięć

Wyświetl plik

@ -69,6 +69,13 @@ if [ ! -e "$EN" ]; then
exit 2
fi
endate=$(git log --pretty="%cd" --date=raw -1 "$EN"|cut -d' ' -f1)
# check if we have a git log of the EN base file. If not, abort
if [ -z "${endate}" ]; then
out "EN file does not have any Git log. Ususally this means the file is new"
exit 0
fi
# Convert to YYYY-MM-DD
ymd=$(date +"%Y-%m-%d" --date="@$endate")
out "Basefile: $EN ( $ymd )"