perf: 构建工具调整

This commit is contained in:
TsMask
2025-03-18 16:01:11 +08:00
parent f4977d071b
commit 8c1a73e9b3
6 changed files with 52 additions and 64 deletions

View File

@@ -26,16 +26,6 @@ usage() {
exit 1
}
# standard env
standardEnv() {
if command -v mysql &> /dev/null || command -v mariadb &> /dev/null; then
echo "MySQL or MariaDB installed"
else
echo "MySQL or MariaDB not installed"
exit 1
fi
}
# Different processing depending on the value of customize
customize() {
cp -rf $OMCEtcDir/vendor/$VENDORS/web/* $OMCEtcDir/web/background
@@ -45,7 +35,6 @@ customize() {
# =========================
# 参数解析
while [[ $# -gt 0 ]]; do
case "$1" in
-i|--install)
@@ -113,13 +102,26 @@ fi
#echo "Customize parameter: $VENDORS"
# =========================
if [ "$MODE" = "standard" ]; then
standardEnv
if [[ "$T_PARAM" == "install" && "$MODE" == "standard" ]]; then
if command -v mysql &> /dev/null || command -v mariadb &> /dev/null; then
echo "MySQL or MariaDB installed"
else
echo "MySQL or MariaDB not installed"
exit 1
fi
rm -rf $OMCEtcDir/default/omc_db.sqlite
fi
if [[ "$T_PARAM" == "install" && "$MODE" == "lite" ]]; then
cp -rf $OMCEtcDir/default/omc_db.sqlite $OMCEtcDir/database/omc_db.sqlite
fi
# =========================
$OMCBinFile -c $confFile --sqlPath $OMCEtcDir/database/$MODE/$T_PARAM --sqlSource $MODE
customize
# ========================= Customize
cp -rf $OMCEtcDir/vendor/$VENDORS/web/* $OMCEtcDir/web/background
cp -rf $OMCEtcDir/vendor/$VENDORS/static/* /usr/local/$VENDORS/static
$OMCBinFile -c $confFile --sqlPath $OMCEtcDir/vendor/$VENDORS/database/$MODE/customized.sql --sqlSource $MODE
# bash setup.sh -i -m standard -c omc