From 9b4935ac10d9e5af8a2e7b84d720376b367456f8 Mon Sep 17 00:00:00 2001 From: msojocs Date: Sun, 28 Aug 2022 20:49:12 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=87=AA=E5=8A=A8=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E7=AA=97=E5=8F=A3=E6=97=A0=E6=B3=95=E5=85=B3=E9=97=AD=20#66?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tools/fix-core.sh | 23 ++++++++++++++++++++++- tools/wxvpkg_unpack.js | 1 + 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/tools/fix-core.sh b/tools/fix-core.sh index 6ec84aa..6a547df 100755 --- a/tools/fix-core.sh +++ b/tools/fix-core.sh @@ -1,5 +1,21 @@ #!/bin/bash root_dir=$(cd `dirname $0`/.. && pwd -P) +set -e +trap 'catchError $LINENO "$BASH_COMMAND"' ERR # 捕获错误情况 +catchError() { + exit_code=$? + if [ $exit_code -ne 0 ]; then + fail "\033[31mcommand: $2\n at $0:$1\n at $STEP\033[0m" + fi + exit $exit_code +} + +notice() { + echo -e "\033[36m $1 \033[0m " +} +fail() { + echo -e "\033[41;37m 失败 \033[0m $1" +} package_dir="$root_dir/package.nw" tmp_dir="$root_dir/tmp/core" @@ -35,6 +51,7 @@ if [[ ! -z $token_find_result ]];then fi # open -a Terminal "`pwd`" --> gnome-terminal +notice "fix terminal" find_result=$( grep -lr 'open -a Terminal "`pwd`"' "$tmp_dir/core.wxvpkg" ) echo "Terminal启动位置: $find_result" if [[ ! -z $find_result ]];then @@ -79,6 +96,7 @@ if [[ "$WINE" != 'true' ]];then fi # fix theme +notice "fix theme" find_result=$( grep -lr "OSThemeController=" "$tmp_dir/core.wxvpkg" ) echo "theme: $find_result" if [[ -n $find_result ]];then @@ -93,8 +111,11 @@ if [[ -n $find_result ]];then fi # fix update check +notice "fix update check" +sed -i 's#