From b0071400b16ebf4b3d969643b9efadc86e279ca7 Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Tue, 18 Mar 2025 17:07:36 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E6=9E=84=E5=BB=BA=E5=B7=A5=E5=85=B7?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/pkg/deb/DEBIAN/postinst | 13 +++++++------ src/framework/database/db/expand.go | 4 ++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/build/pkg/deb/DEBIAN/postinst b/build/pkg/deb/DEBIAN/postinst index c6c2b00e..e65cee55 100644 --- a/build/pkg/deb/DEBIAN/postinst +++ b/build/pkg/deb/DEBIAN/postinst @@ -19,17 +19,18 @@ if [ ! -f $RootDir/omc.conf ]; then # read environment parameter and to do if [ -n "$M_PARAM" ] && [ -n "$C_PARAM" ]; then - bash $RootDir/script/setup.sh -i -m $M_PARAM -c $C_PARAM + bash $RootDir/script/setup.sh -i -m $M_PARAM -c $C_PARAM elif [ -n "$C_PARAM" ]; then - bash $RootDir/script/setup.sh -i -c $C_PARAM + bash $RootDir/script/setup.sh -i -c $C_PARAM else - bash $RootDir/script/setup.sh -i + bash $RootDir/script/setup.sh -i fi - # exit while failed to run err if [ $? -ne 0 ]; then - echo "Initialization failure." - exit 1 + echo "Initialization failure." + rm -rf $RootDir + exit 1 fi + rm -rf $RootDir/vendor systemctl daemon-reload diff --git a/src/framework/database/db/expand.go b/src/framework/database/db/expand.go index 7aaa51b7..7212e4ca 100644 --- a/src/framework/database/db/expand.go +++ b/src/framework/database/db/expand.go @@ -60,8 +60,8 @@ func ImportSQL() { processSQLFile(db, sqlPath) } - log.Println("Import SQL End") - os.Exit(1) + log.Println("process success") + os.Exit(0) } // 处理单个SQL文件的通用函数