[X2Go-Commits] [buildscripts] 01/01: bin/gitdate: detect macOS and call date in a different way.

git-admin at x2go.org git-admin at x2go.org
Wed Dec 14 23:24:18 CET 2022


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch master
in repository buildscripts.

commit 12af527050760507939006dbdbbba6ddbb59e44d
Author: Mihai Moldovan <ionic at ionic.de>
Date:   Wed Dec 14 23:23:46 2022 +0100

    bin/gitdate: detect macOS and call date in a different way.
    
    It (naturally) doesn't support the GNU syntax.
---
 bin/gitdate | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/bin/gitdate b/bin/gitdate
index 94226d1..085181a 100755
--- a/bin/gitdate
+++ b/bin/gitdate
@@ -23,4 +23,9 @@
 # Additionally, we only request the first line as a safety measure, although
 # there should only be one to begin with.
 typeset ts="$(git show --no-color -s --pretty='%ct' 'HEAD' | head -n '1')"
-date --date='TZ="UTC" @'"${ts}" -u '+%Y%m%d'
+
+if [[ 'Darwin' == "$(uname -s)" ]]; then
+	TZ='UTC' date -u -r "${ts}" '+%Y%m%d'
+else
+	date --date='TZ="UTC" @'"${ts}" -u '+%Y%m%d'
+fi

--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/buildscripts.git


More information about the x2go-commits mailing list