diff --git a/bin/run.sh b/bin/run.sh index 6ddb420..cfe52e1 100644 --- a/bin/run.sh +++ b/bin/run.sh @@ -4,6 +4,7 @@ run() { local script_dir=$(cd "$(dirname "$0")"; pwd) local config_dir=$(readlink -f "$script_dir/../") + local config_file="$config_dir/config.json" source "$script_dir/utils/base.sh" @@ -14,11 +15,11 @@ run() { check_bash_installed # 如果配置没有创建 - if [ ! -e "$config_dir/config/config.json" ]; then - touch "$config_dir/config/config.json" + if [ ! -e "$config_file" ]; then + touch "$config_file" fi - local password=$(jq -r '.auth.password' "$config_dir/config/config.json") - if [ ! -s "$config_dir/config/config.json" ] || [ "$password" = "你的密码" ]; then + local password=$(jq -r '.auth.password' "$config_file") + if [ ! -s "$config_file" ] || [ "$password" = "你的密码" ]; then bash "$script_dir/create_config.sh" # 创建配置 fi