From d07e27a6cd0579b505fe30cdc2abc24c32491dbd Mon Sep 17 00:00:00 2001
From: "alexandr.kravchenko" <alexander.kravchenko@demlabs.net>
Date: Tue, 11 Feb 2020 19:38:53 +0500
Subject: [PATCH] fixed checking on build environment

---
 prod_build/linux/debian/scripts/pre-build.sh | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/prod_build/linux/debian/scripts/pre-build.sh b/prod_build/linux/debian/scripts/pre-build.sh
index a5edcfbc..5f9ce933 100755
--- a/prod_build/linux/debian/scripts/pre-build.sh
+++ b/prod_build/linux/debian/scripts/pre-build.sh
@@ -92,8 +92,9 @@ extract_version_number
 ### cause information from this changelog (version) is used to write package metadata. And we had messed up for a long time because of desyncing. 
 ### This is a solution. We modify the changelog only if there are updates and not on build servers. And of course if it's not cmake-based build project.
 ### let's keep those comments here for a while
-
-if [ $( gitlab-runner -v 2> /dev/null ; echo $? ) == 0 ]; then  
+NOTONBUILDSERVER=0
+gitlab-runner -v 2&>>/dev/null || NOTONBUILDSERVER=$?
+if [ $NOTONBUILDSERVER == 0 ]; then  
 	echo "[WRN] on build platform. Version won't be changed" # okay, so this echo wont be outputted as the condition is not true
 
 elif [ ! -e debian/changelog ]; then  ### I guess this what's supposed to be added in order to solve the issue with the changelog?+
-- 
GitLab