diff --git a/gitlab/functions.sh b/gitlab/functions.sh index 180a119695cb25f6b7dc01764c55415b1d36af49..99c31df2efe6e118191115b0bf987484e0757ec1 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