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