mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-12 11:19:56 +00:00
no message
This commit is contained in:
parent
74ba1cc723
commit
05d5d5a967
318
cmd
318
cmd
@ -661,148 +661,180 @@ if [[ "$1" != "electron" ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# 执行命令
|
# 执行命令
|
||||||
if [[ "$1" == "install" ]]; then
|
case "$1" in
|
||||||
shift 1
|
"install")
|
||||||
run_install
|
shift 1
|
||||||
elif [[ "$1" == "update" ]]; then
|
run_install
|
||||||
shift 1
|
;;
|
||||||
run_update
|
"update")
|
||||||
elif [[ "$1" == "uninstall" ]]; then
|
shift 1
|
||||||
shift 1
|
run_update
|
||||||
run_uninstall
|
;;
|
||||||
elif [[ "$1" == "port" ]]; then
|
"uninstall")
|
||||||
shift 1
|
shift 1
|
||||||
env_set APP_PORT "$1"
|
run_uninstall
|
||||||
$COMPOSE up -d
|
;;
|
||||||
success "修改成功"
|
"port")
|
||||||
info "地址: http://${GreenBG}127.0.0.1:$(env_get APP_PORT)${Font}"
|
shift 1
|
||||||
elif [[ "$1" == "url" ]]; then
|
env_set APP_PORT "$1"
|
||||||
shift 1
|
$COMPOSE up -d
|
||||||
env_set APP_URL "$1"
|
success "修改成功"
|
||||||
restart_php
|
info "地址: http://${GreenBG}127.0.0.1:$(env_get APP_PORT)${Font}"
|
||||||
success "修改成功"
|
;;
|
||||||
elif [[ "$1" == "env" ]]; then
|
"url")
|
||||||
shift 1
|
shift 1
|
||||||
if [ -n "$1" ]; then
|
env_set APP_URL "$1"
|
||||||
env_set $1 "$2"
|
|
||||||
fi
|
|
||||||
restart_php
|
|
||||||
success "修改成功"
|
|
||||||
elif [[ "$1" == "repassword" ]]; then
|
|
||||||
shift 1
|
|
||||||
run_exec mariadb "sh /etc/mysql/repassword.sh $@"
|
|
||||||
elif [[ "$1" == "serve" ]] || [[ "$1" == "dev" ]]; then
|
|
||||||
shift 1
|
|
||||||
run_compile dev
|
|
||||||
elif [[ "$1" == "build" ]] || [[ "$1" == "prod" ]]; then
|
|
||||||
shift 1
|
|
||||||
run_compile prod
|
|
||||||
elif [[ "$1" == "appbuild" ]] || [[ "$1" == "buildapp" ]]; then
|
|
||||||
shift 1
|
|
||||||
run_electron app "$@"
|
|
||||||
elif [[ "$1" == "electron" ]]; then
|
|
||||||
shift 1
|
|
||||||
run_electron "$@"
|
|
||||||
elif [[ "$1" == "eeui" ]]; then
|
|
||||||
shift 1
|
|
||||||
cli="$@"
|
|
||||||
por=""
|
|
||||||
if [[ "$cli" == "build" ]]; then
|
|
||||||
cli="build --simple"
|
|
||||||
elif [[ "$cli" == "dev" ]]; then
|
|
||||||
por="-p 8880:8880"
|
|
||||||
fi
|
|
||||||
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
|
|
||||||
shift 1
|
|
||||||
npm "$@"
|
|
||||||
pushd electron || exit
|
|
||||||
npm "$@"
|
|
||||||
popd || exit
|
|
||||||
docker run --rm -it -v ${cur_path}/resources/mobile:/work -w /work --entrypoint=/bin/bash node:16 -c "npm $@"
|
|
||||||
elif [[ "$1" == "doc" ]]; then
|
|
||||||
shift 1
|
|
||||||
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
|
|
||||||
elif [[ "$1" == "debug" ]]; then
|
|
||||||
shift 1
|
|
||||||
switch_debug "$@"
|
|
||||||
info "success"
|
|
||||||
elif [[ "$1" == "https" ]]; then
|
|
||||||
shift 1
|
|
||||||
if [[ "$1" == "agent" ]] || [[ "$1" == "true" ]]; then
|
|
||||||
env_set APP_SCHEME "true"
|
|
||||||
elif [[ "$1" == "close" ]] || [[ "$1" == "auto" ]]; then
|
|
||||||
env_set APP_SCHEME "auto"
|
|
||||||
else
|
|
||||||
https_auto
|
|
||||||
fi
|
|
||||||
restart_php
|
|
||||||
elif [[ "$1" == "artisan" ]]; then
|
|
||||||
shift 1
|
|
||||||
e="php artisan $@" && run_exec php "$e"
|
|
||||||
elif [[ "$1" == "php" ]]; then
|
|
||||||
shift 1
|
|
||||||
if [[ "$1" == "restart" ]] || [[ "$1" == "reboot" ]]; then
|
|
||||||
restart_php
|
restart_php
|
||||||
else
|
success "修改成功"
|
||||||
e="php $@" && run_exec php "$e"
|
;;
|
||||||
fi
|
"env")
|
||||||
elif [[ "$1" == "nginx" ]]; then
|
shift 1
|
||||||
shift 1
|
if [ -n "$1" ]; then
|
||||||
e="nginx $@" && run_exec nginx "$e"
|
env_set $1 "$2"
|
||||||
elif [[ "$1" == "redis" ]]; then
|
fi
|
||||||
shift 1
|
restart_php
|
||||||
e="redis $@" && run_exec redis "$e"
|
success "修改成功"
|
||||||
elif [[ "$1" == "mysql" ]]; then
|
;;
|
||||||
shift 1
|
"repassword")
|
||||||
if [[ "$1" == "backup" ]] || [[ "$1" == "b" ]]; then
|
shift 1
|
||||||
run_mysql backup
|
run_exec mariadb "sh /etc/mysql/repassword.sh $@"
|
||||||
elif [[ "$1" == "recovery" ]] || [[ "$1" == "r" ]]; then
|
;;
|
||||||
run_mysql recovery
|
"serve"|"dev")
|
||||||
else
|
shift 1
|
||||||
e="mysql $@" && run_exec mariadb "$e"
|
run_compile dev
|
||||||
fi
|
;;
|
||||||
elif [[ "$1" == "composer" ]]; then
|
"build"|"prod")
|
||||||
shift 1
|
shift 1
|
||||||
e="composer $@" && run_exec php "$e"
|
run_compile prod
|
||||||
elif [[ "$1" == "service" ]]; then
|
;;
|
||||||
shift 1
|
"appbuild"|"buildapp")
|
||||||
e="service $@" && run_exec php "$e"
|
shift 1
|
||||||
elif [[ "$1" == "super" ]] || [[ "$1" == "supervisorctl" ]]; then
|
run_electron app "$@"
|
||||||
shift 1
|
;;
|
||||||
e="supervisorctl $@" && run_exec php "$e"
|
"electron")
|
||||||
elif [[ "$1" == "models" ]]; then
|
shift 1
|
||||||
shift 1
|
run_electron "$@"
|
||||||
run_exec php "php app/Models/clearHelper.php"
|
;;
|
||||||
run_exec php "php artisan ide-helper:models -W"
|
"eeui")
|
||||||
elif [[ "$1" == "translate" ]]; then
|
shift 1
|
||||||
shift 1
|
cli="$@"
|
||||||
run_exec php "cd /var/www/language && php translate.php"
|
por=""
|
||||||
elif [[ "$1" == "restart" ]]; then
|
if [[ "$cli" == "build" ]]; then
|
||||||
shift 1
|
cli="build --simple"
|
||||||
$COMPOSE stop "$@"
|
elif [[ "$cli" == "dev" ]]; then
|
||||||
$COMPOSE start "$@"
|
por="-p 8880:8880"
|
||||||
elif [[ "$1" == "reup" ]]; then
|
fi
|
||||||
shift 1
|
docker run -it --rm -v ${cur_path}/resources/mobile:/work -w /work ${por} kuaifan/eeui-cli:0.0.1 eeui ${cli}
|
||||||
remove_by_network
|
;;
|
||||||
$COMPOSE down --remove-orphans
|
"npm")
|
||||||
$COMPOSE up -d
|
shift 1
|
||||||
elif [[ "$1" == "down" ]]; then
|
npm "$@"
|
||||||
shift 1
|
pushd electron || exit
|
||||||
remove_by_network
|
npm "$@"
|
||||||
if [[ $# -eq 0 ]]; then
|
popd || exit
|
||||||
|
docker run --rm -it -v ${cur_path}/resources/mobile:/work -w /work --entrypoint=/bin/bash node:16 -c "npm $@"
|
||||||
|
;;
|
||||||
|
"doc")
|
||||||
|
shift 1
|
||||||
|
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
|
||||||
|
;;
|
||||||
|
"debug")
|
||||||
|
shift 1
|
||||||
|
switch_debug "$@"
|
||||||
|
info "success"
|
||||||
|
;;
|
||||||
|
"https")
|
||||||
|
shift 1
|
||||||
|
if [[ "$1" == "agent" ]] || [[ "$1" == "true" ]]; then
|
||||||
|
env_set APP_SCHEME "true"
|
||||||
|
elif [[ "$1" == "close" ]] || [[ "$1" == "auto" ]]; then
|
||||||
|
env_set APP_SCHEME "auto"
|
||||||
|
else
|
||||||
|
https_auto
|
||||||
|
fi
|
||||||
|
restart_php
|
||||||
|
;;
|
||||||
|
"artisan")
|
||||||
|
shift 1
|
||||||
|
e="php artisan $@" && run_exec php "$e"
|
||||||
|
;;
|
||||||
|
"php")
|
||||||
|
shift 1
|
||||||
|
if [[ "$1" == "restart" ]] || [[ "$1" == "reboot" ]]; then
|
||||||
|
restart_php
|
||||||
|
else
|
||||||
|
e="php $@" && run_exec php "$e"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
"nginx")
|
||||||
|
shift 1
|
||||||
|
e="nginx $@" && run_exec nginx "$e"
|
||||||
|
;;
|
||||||
|
"redis")
|
||||||
|
shift 1
|
||||||
|
e="redis $@" && run_exec redis "$e"
|
||||||
|
;;
|
||||||
|
"mysql")
|
||||||
|
shift 1
|
||||||
|
if [[ "$1" == "backup" ]] || [[ "$1" == "b" ]]; then
|
||||||
|
run_mysql backup
|
||||||
|
elif [[ "$1" == "recovery" ]] || [[ "$1" == "r" ]]; then
|
||||||
|
run_mysql recovery
|
||||||
|
else
|
||||||
|
e="mysql $@" && run_exec mariadb "$e"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
"composer")
|
||||||
|
shift 1
|
||||||
|
e="composer $@" && run_exec php "$e"
|
||||||
|
;;
|
||||||
|
"service")
|
||||||
|
shift 1
|
||||||
|
e="service $@" && run_exec php "$e"
|
||||||
|
;;
|
||||||
|
"super"|"supervisorctl")
|
||||||
|
shift 1
|
||||||
|
e="supervisorctl $@" && run_exec php "$e"
|
||||||
|
;;
|
||||||
|
"models")
|
||||||
|
shift 1
|
||||||
|
run_exec php "php app/Models/clearHelper.php"
|
||||||
|
run_exec php "php artisan ide-helper:models -W"
|
||||||
|
;;
|
||||||
|
"translate")
|
||||||
|
shift 1
|
||||||
|
run_exec php "cd /var/www/language && php translate.php"
|
||||||
|
;;
|
||||||
|
"restart")
|
||||||
|
shift 1
|
||||||
|
$COMPOSE stop "$@"
|
||||||
|
$COMPOSE start "$@"
|
||||||
|
;;
|
||||||
|
"reup")
|
||||||
|
shift 1
|
||||||
|
remove_by_network
|
||||||
$COMPOSE down --remove-orphans
|
$COMPOSE down --remove-orphans
|
||||||
else
|
$COMPOSE up -d
|
||||||
$COMPOSE down "$@"
|
;;
|
||||||
fi
|
"down")
|
||||||
elif [[ "$1" == "up" ]]; then
|
shift 1
|
||||||
shift 1
|
remove_by_network
|
||||||
if [[ $# -eq 0 ]]; then
|
if [[ $# -eq 0 ]]; then
|
||||||
$COMPOSE up -d --remove-orphans
|
$COMPOSE down --remove-orphans
|
||||||
else
|
else
|
||||||
$COMPOSE up "$@"
|
$COMPOSE down "$@"
|
||||||
fi
|
fi
|
||||||
else
|
;;
|
||||||
$COMPOSE "$@"
|
"up")
|
||||||
fi
|
shift 1
|
||||||
|
if [[ $# -eq 0 ]]; then
|
||||||
|
$COMPOSE up -d --remove-orphans
|
||||||
|
else
|
||||||
|
$COMPOSE up "$@"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
$COMPOSE "$@"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user