From a47fdcb46bea7ce17347ac808b834321aff8f8cc Mon Sep 17 00:00:00 2001 From: Andre Anjos <andre.anjos@idiap.ch> Date: Fri, 18 Aug 2017 16:35:27 +0200 Subject: [PATCH] Fix date printout; Set UTF-8 compatible language and settings --- gitlab/functions.sh | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/gitlab/functions.sh b/gitlab/functions.sh index 180a119..99c31df 100644 --- a/gitlab/functions.sh +++ b/gitlab/functions.sh @@ -9,7 +9,6 @@ osname() { [[ "$(uname -s)" == "Darwin" ]] && echo "macosx" || echo "linux" } - # Determines the visibility of the current package visibility() { local code=$(curl --output /dev/null --silent --fail --write-out "%{http_code}" ${CI_PROJECT_URL}) @@ -37,9 +36,20 @@ is_master() { } +# Checks whether to use "date" or "gdate" +gnudate() { + if hash gdate 2>/dev/null; then + echo gdate + else + echo date + fi +} +DATE=`gnudate` + + # datetime prefix for logging log_datetime() { - echo "($(date +%T.%3N))" + echo "($(${DATE} +%T.%3N))" } # Functions for coloring echo commands @@ -475,5 +485,7 @@ export_env DOC_SERVER_PREFIX check_env DOC_UPLOADS # Sets up the language so Unicode filenames are considered correctly -LANG="C" +LANG="en_US.UTF-8" +LC_ALL="${LANG}" export_env LANG +export_env LC_ALL -- GitLab