getting app version from package.json

This commit is contained in:
MaysWind
2021-01-12 00:27:21 +08:00
parent db7064cccf
commit 1a33528710
+1 -1
View File
@@ -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"`;