aboutsummaryrefslogtreecommitdiffstats
path: root/git-version.sh
diff options
context:
space:
mode:
authorBruce Dubbs <bdubbs@linuxfromscratch.org>2021-04-06 17:28:27 -0500
committerBruce Dubbs <bdubbs@linuxfromscratch.org>2021-04-06 17:28:27 -0500
commit8186f16b0f98768aedf1f6458a0efed41ee76be8 (patch)
treef7f284dac38b47a1c114624a4b6a0441045d870a /git-version.sh
parent6b505dabb8420d1ae41a6d68772fe8ad4b252dd8 (diff)
Quiet git status check. Make sed more readable.
Diffstat (limited to 'git-version.sh')
-rwxr-xr-xgit-version.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/git-version.sh b/git-version.sh
index 898d5b96f..0512a26aa 100755
--- a/git-version.sh
+++ b/git-version.sh
@@ -1,6 +1,6 @@
#!/bin/sh
-if ! git status; then
+if ! git status > /dev/null; then
# Either it's not a git repository, or git is unavaliable.
# Just workaround.
echo "<!ENTITY version \"unknown\">" > version.ent
@@ -19,7 +19,7 @@ short_date=$(date --date "$commit_date" "+%Y%m%d")
year=$(date --date "$commit_date" "+%Y")
month=$(date --date "$commit_date" "+%B")
month_digit=$(date --date "$commit_date" "+%m")
-day=$(date --date "$commit_date" "+%d" | sed 's@^0@@')
+day=$(date --date "$commit_date" "+%d" | sed 's/^0//')
case $day in
"1" | "21" | "31" ) suffix="st";;