From 1a33528710fbdaf5a56c47839613c578f92666b8 Mon Sep 17 00:00:00 2001 From: MaysWind Date: Tue, 12 Jan 2021 00:27:21 +0800 Subject: [PATCH] getting app version from package.json --- build-docker.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-docker.sh b/build-docker.sh index ef2cbced..e9b60d28 100755 --- a/build-docker.sh +++ b/build-docker.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash mode=$1; -version=`grep "const LAB_VERSION" lab.go | awk -F '=' '{print $2}' | tr -d ' ' | tr -d '"'`; +version=`grep '"version": ' package.json | awk -F ':' '{print $2}' | tr -d ' ' | tr -d ',' | tr -d '"'`; if [ "$mode" == "--snapshot" ]; then version="SNAPSHOT-"`date "+%Y%m%d"`;