# HG changeset patch
# User Christophe de Vienne <christophe@cdevienne.info>
# Date 1733347564 -3600
#      Wed Dec 04 22:26:04 2024 +0100
# Node ID 5d141f571cf00f4311f863f23dbf9533c7f43318
# Parent  cb1c7bfe4226047f20ef74296706e7ef5efdedd1
build_version_file: fix when run within tag-less cset

diff --git a/tools/build_version_file/main.go b/tools/build_version_file/main.go
--- a/tools/build_version_file/main.go
+++ b/tools/build_version_file/main.go
@@ -21,13 +21,16 @@
 		}
 		lines = append(lines, l)
 	}
-	if len(lines) != 1 {
+	if len(lines) > 1 {
 		fmt.Println(string(out))
 
 		return "", errors.New("Expects a single line")
 	}
+	if len(lines) == 1 {
+		return lines[0], err
+	}
 
-	return lines[0], err
+	return "", err
 }
 
 func mustSysCmd(name string, arg ...string) string {