no message

This commit is contained in:
kuaifan 2025-05-24 19:06:14 +08:00
parent 74ba1cc723
commit 05d5d5a967

96
cmd
View File

@ -661,49 +661,61 @@ if [[ "$1" != "electron" ]]; then
fi fi
# 执行命令 # 执行命令
if [[ "$1" == "install" ]]; then case "$1" in
"install")
shift 1 shift 1
run_install run_install
elif [[ "$1" == "update" ]]; then ;;
"update")
shift 1 shift 1
run_update run_update
elif [[ "$1" == "uninstall" ]]; then ;;
"uninstall")
shift 1 shift 1
run_uninstall run_uninstall
elif [[ "$1" == "port" ]]; then ;;
"port")
shift 1 shift 1
env_set APP_PORT "$1" env_set APP_PORT "$1"
$COMPOSE up -d $COMPOSE up -d
success "修改成功" success "修改成功"
info "地址: http://${GreenBG}127.0.0.1:$(env_get APP_PORT)${Font}" info "地址: http://${GreenBG}127.0.0.1:$(env_get APP_PORT)${Font}"
elif [[ "$1" == "url" ]]; then ;;
"url")
shift 1 shift 1
env_set APP_URL "$1" env_set APP_URL "$1"
restart_php restart_php
success "修改成功" success "修改成功"
elif [[ "$1" == "env" ]]; then ;;
"env")
shift 1 shift 1
if [ -n "$1" ]; then if [ -n "$1" ]; then
env_set $1 "$2" env_set $1 "$2"
fi fi
restart_php restart_php
success "修改成功" success "修改成功"
elif [[ "$1" == "repassword" ]]; then ;;
"repassword")
shift 1 shift 1
run_exec mariadb "sh /etc/mysql/repassword.sh $@" run_exec mariadb "sh /etc/mysql/repassword.sh $@"
elif [[ "$1" == "serve" ]] || [[ "$1" == "dev" ]]; then ;;
"serve"|"dev")
shift 1 shift 1
run_compile dev run_compile dev
elif [[ "$1" == "build" ]] || [[ "$1" == "prod" ]]; then ;;
"build"|"prod")
shift 1 shift 1
run_compile prod run_compile prod
elif [[ "$1" == "appbuild" ]] || [[ "$1" == "buildapp" ]]; then ;;
"appbuild"|"buildapp")
shift 1 shift 1
run_electron app "$@" run_electron app "$@"
elif [[ "$1" == "electron" ]]; then ;;
"electron")
shift 1 shift 1
run_electron "$@" run_electron "$@"
elif [[ "$1" == "eeui" ]]; then ;;
"eeui")
shift 1 shift 1
cli="$@" cli="$@"
por="" por=""
@ -713,22 +725,26 @@ elif [[ "$1" == "eeui" ]]; then
por="-p 8880:8880" por="-p 8880:8880"
fi fi
docker run -it --rm -v ${cur_path}/resources/mobile:/work -w /work ${por} kuaifan/eeui-cli:0.0.1 eeui ${cli} docker run -it --rm -v ${cur_path}/resources/mobile:/work -w /work ${por} kuaifan/eeui-cli:0.0.1 eeui ${cli}
elif [[ "$1" == "npm" ]]; then ;;
"npm")
shift 1 shift 1
npm "$@" npm "$@"
pushd electron || exit pushd electron || exit
npm "$@" npm "$@"
popd || exit popd || exit
docker run --rm -it -v ${cur_path}/resources/mobile:/work -w /work --entrypoint=/bin/bash node:16 -c "npm $@" docker run --rm -it -v ${cur_path}/resources/mobile:/work -w /work --entrypoint=/bin/bash node:16 -c "npm $@"
elif [[ "$1" == "doc" ]]; then ;;
"doc")
shift 1 shift 1
run_exec php "php app/Http/Controllers/Api/apidoc.php" run_exec php "php app/Http/Controllers/Api/apidoc.php"
docker run -it --rm -v ${cur_path}:/home/node/apidoc kuaifan/apidoc -i app/Http/Controllers/Api -o public/docs docker run -it --rm -v ${cur_path}:/home/node/apidoc kuaifan/apidoc -i app/Http/Controllers/Api -o public/docs
elif [[ "$1" == "debug" ]]; then ;;
"debug")
shift 1 shift 1
switch_debug "$@" switch_debug "$@"
info "success" info "success"
elif [[ "$1" == "https" ]]; then ;;
"https")
shift 1 shift 1
if [[ "$1" == "agent" ]] || [[ "$1" == "true" ]]; then if [[ "$1" == "agent" ]] || [[ "$1" == "true" ]]; then
env_set APP_SCHEME "true" env_set APP_SCHEME "true"
@ -738,23 +754,28 @@ elif [[ "$1" == "https" ]]; then
https_auto https_auto
fi fi
restart_php restart_php
elif [[ "$1" == "artisan" ]]; then ;;
"artisan")
shift 1 shift 1
e="php artisan $@" && run_exec php "$e" e="php artisan $@" && run_exec php "$e"
elif [[ "$1" == "php" ]]; then ;;
"php")
shift 1 shift 1
if [[ "$1" == "restart" ]] || [[ "$1" == "reboot" ]]; then if [[ "$1" == "restart" ]] || [[ "$1" == "reboot" ]]; then
restart_php restart_php
else else
e="php $@" && run_exec php "$e" e="php $@" && run_exec php "$e"
fi fi
elif [[ "$1" == "nginx" ]]; then ;;
"nginx")
shift 1 shift 1
e="nginx $@" && run_exec nginx "$e" e="nginx $@" && run_exec nginx "$e"
elif [[ "$1" == "redis" ]]; then ;;
"redis")
shift 1 shift 1
e="redis $@" && run_exec redis "$e" e="redis $@" && run_exec redis "$e"
elif [[ "$1" == "mysql" ]]; then ;;
"mysql")
shift 1 shift 1
if [[ "$1" == "backup" ]] || [[ "$1" == "b" ]]; then if [[ "$1" == "backup" ]] || [[ "$1" == "b" ]]; then
run_mysql backup run_mysql backup
@ -763,32 +784,40 @@ elif [[ "$1" == "mysql" ]]; then
else else
e="mysql $@" && run_exec mariadb "$e" e="mysql $@" && run_exec mariadb "$e"
fi fi
elif [[ "$1" == "composer" ]]; then ;;
"composer")
shift 1 shift 1
e="composer $@" && run_exec php "$e" e="composer $@" && run_exec php "$e"
elif [[ "$1" == "service" ]]; then ;;
"service")
shift 1 shift 1
e="service $@" && run_exec php "$e" e="service $@" && run_exec php "$e"
elif [[ "$1" == "super" ]] || [[ "$1" == "supervisorctl" ]]; then ;;
"super"|"supervisorctl")
shift 1 shift 1
e="supervisorctl $@" && run_exec php "$e" e="supervisorctl $@" && run_exec php "$e"
elif [[ "$1" == "models" ]]; then ;;
"models")
shift 1 shift 1
run_exec php "php app/Models/clearHelper.php" run_exec php "php app/Models/clearHelper.php"
run_exec php "php artisan ide-helper:models -W" run_exec php "php artisan ide-helper:models -W"
elif [[ "$1" == "translate" ]]; then ;;
"translate")
shift 1 shift 1
run_exec php "cd /var/www/language && php translate.php" run_exec php "cd /var/www/language && php translate.php"
elif [[ "$1" == "restart" ]]; then ;;
"restart")
shift 1 shift 1
$COMPOSE stop "$@" $COMPOSE stop "$@"
$COMPOSE start "$@" $COMPOSE start "$@"
elif [[ "$1" == "reup" ]]; then ;;
"reup")
shift 1 shift 1
remove_by_network remove_by_network
$COMPOSE down --remove-orphans $COMPOSE down --remove-orphans
$COMPOSE up -d $COMPOSE up -d
elif [[ "$1" == "down" ]]; then ;;
"down")
shift 1 shift 1
remove_by_network remove_by_network
if [[ $# -eq 0 ]]; then if [[ $# -eq 0 ]]; then
@ -796,13 +825,16 @@ elif [[ "$1" == "down" ]]; then
else else
$COMPOSE down "$@" $COMPOSE down "$@"
fi fi
elif [[ "$1" == "up" ]]; then ;;
"up")
shift 1 shift 1
if [[ $# -eq 0 ]]; then if [[ $# -eq 0 ]]; then
$COMPOSE up -d --remove-orphans $COMPOSE up -d --remove-orphans
else else
$COMPOSE up "$@" $COMPOSE up "$@"
fi fi
else ;;
*)
$COMPOSE "$@" $COMPOSE "$@"
fi ;;
esac