From 418714ca653866994e340b6c1e7e13eeb0e45259 Mon Sep 17 00:00:00 2001 From: msojocs Date: Sun, 6 Mar 2022 12:16:01 +0800 Subject: [PATCH] =?UTF-8?q?update:=20=E8=B0=83=E6=95=B4=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E4=BC=98=E5=85=88=E7=BA=A7=E5=A4=A7=E4=BA=8E=E7=8E=AF=E5=A2=83?= =?UTF-8?q?=E5=8F=98=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tools/build-appimage.sh | 5 ++--- tools/build-deb.sh | 2 +- tools/build-deepin.sh | 2 +- tools/build-release.sh | 19 +++++++++---------- tools/build-tar.sh | 22 ++++++++++------------ 5 files changed, 23 insertions(+), 27 deletions(-) diff --git a/tools/build-appimage.sh b/tools/build-appimage.sh index 8c72e74..03e2a2b 100755 --- a/tools/build-appimage.sh +++ b/tools/build-appimage.sh @@ -12,11 +12,10 @@ fail() { echo -e "\033[41;37m 失败 \033[0m $1" } - -if [ -z $VERSION ];then +if [ -n "$1" ];then export VERSION=$1 fi -if [ -z $ARCH ];then +if [ -n "$2" ];then export ARCH=$2 fi diff --git a/tools/build-deb.sh b/tools/build-deb.sh index 64304cb..f5865c7 100755 --- a/tools/build-deb.sh +++ b/tools/build-deb.sh @@ -16,7 +16,7 @@ root_dir=$(cd `dirname $0`/.. && pwd -P) DEVTOOLS_VERSION=$( cat "$root_dir/package.nw/package.json" | grep -m 1 -Eo "\"[0-9]{1}\.[0-9]{2}\.[0-9]+" ) DEVTOOLS_VERSION="${DEVTOOLS_VERSION//\"/}" echo $BUILD_VERSION -if [ -z "$BUILD_VERSION" ];then +if [ -n "$1" ];then export BUILD_VERSION=$1 fi if [ -z "$BUILD_VERSION" ];then diff --git a/tools/build-deepin.sh b/tools/build-deepin.sh index bd1d979..e7a63a5 100755 --- a/tools/build-deepin.sh +++ b/tools/build-deepin.sh @@ -12,7 +12,7 @@ root_dir=$(cd `dirname $0`/.. && pwd -P) DEVTOOLS_VERSION=$( cat "$root_dir/package.nw/package.json" | grep -m 1 -Eo "\"[0-9]{1}\.[0-9]{2}\.[0-9]+" ) DEVTOOLS_VERSION="${DEVTOOLS_VERSION//\"/}" echo $BUILD_VERSION -if [ -z "$BUILD_VERSION" ];then +if [ -n "$1" ];then export BUILD_VERSION=$1 fi if [ -z "$BUILD_VERSION" ];then diff --git a/tools/build-release.sh b/tools/build-release.sh index 4fcec7c..1c9fea6 100755 --- a/tools/build-release.sh +++ b/tools/build-release.sh @@ -6,26 +6,25 @@ # 脚本执行前提,已完成支持wine的基本构建 set -e -root_dir=$(cd `dirname $0`/.. && pwd -P) -tmp_dir="$root_dir/tmp" -if [ -z $VERSION ];then - export VERSION=$2 -fi -if [ -z $ARCH ];then - export ARCH=$1 -fi - success() { echo -e "\033[42;37m 成功 \033[0m $1" } notice() { echo -e "\033[36m $1 \033[0m " } - fail() { echo -e "\033[41;37m 失败 \033[0m $1" } +root_dir=$(cd `dirname $0`/.. && pwd -P) +tmp_dir="$root_dir/tmp" +if [ -n "$2" ];then + export VERSION=$2 +fi +if [ -n "$1" ];then + export ARCH=$1 +fi + DEVTOOLS_VERSION=$( cat "$root_dir/package.nw/package.json" | grep -m 1 -Eo "\"[0-9]{1}\.[0-9]{2}\.[0-9]+" ) DEVTOOLS_VERSION="${DEVTOOLS_VERSION//\"/}" diff --git a/tools/build-tar.sh b/tools/build-tar.sh index b12c618..ebdc664 100755 --- a/tools/build-tar.sh +++ b/tools/build-tar.sh @@ -7,28 +7,26 @@ # 脚本执行前提,已完成支持wine的基本构建 set -e -root_dir=$(cd `dirname $0`/.. && pwd -P) -tmp_dir="$root_dir/tmp" -store_dir="$tmp_dir/build" -mkdir -p $store_dir -if [ -z $VERSION ];then - export VERSION=$1 -fi -if [ -z $ARCH ];then - export ARCH=$2 -fi - success() { echo -e "\033[42;37m 成功 \033[0m $1" } notice() { echo -e "\033[36m $1 \033[0m " } - fail() { echo -e "\033[41;37m 失败 \033[0m $1" } +root_dir=$(cd `dirname $0`/.. && pwd -P) +tmp_dir="$root_dir/tmp" +store_dir="$tmp_dir/build" +mkdir -p $store_dir +if [ -n "$1" ];then + export VERSION=$1 +fi +if [ -n "$2" ];then + export ARCH=$2 +fi if [[ $VERSION == '' ]];then fail "请指定版本" exit 1