From eaa12672748682b4832c6eaed1d1edfab6360cde Mon Sep 17 00:00:00 2001 From: per1234 Date: Tue, 22 Dec 2020 10:32:49 -0800 Subject: [PATCH] Suppress innocuous error message from tag determination The taskfile uses a Git command to get the current tag name. When there is no tag, it produces an error message every time a task is run: fatal: No tags can describe 'a58dfe994fdd94aa98ccc98b327d49f347384c2f'. Try --always, or create some tags. This error message is expected and doesn't impact the functionality of the taskfile, but it might cause confusion. The solution is to redirect the stderr from the command to /dev/null, which won't affect the functionality since the tag name is output on stdout. --- DistTasks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DistTasks.yml b/DistTasks.yml index 724a554c2..720d65818 100644 --- a/DistTasks.yml +++ b/DistTasks.yml @@ -191,7 +191,7 @@ tasks: vars: TAG: - sh: echo "`git describe --tags --abbrev=0`" + sh: echo "`git describe --tags --abbrev=0 2> /dev/null`" TIMESTAMP_SHORT: sh: echo "{{now | date "20060102"}}" VERSION: "{{if .CUSTOM_VERSION}}{{.CUSTOM_VERSION}}-{{.TIMESTAMP_SHORT}}{{else}}{{.TAG}}{{end}}"