From d6188ebafb1a88d20515343f9f3f21cf920639ae Mon Sep 17 00:00:00 2001 From: Olia Lisa Date: Wed, 14 Jan 2026 00:01:18 +0800 Subject: [PATCH] update --- bin/run.sh | 2 +- bin/update_port.sh | 4 ++-- install.sh | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/run.sh b/bin/run.sh index 4ec95e9..5051c43 100644 --- a/bin/run.sh +++ b/bin/run.sh @@ -1,7 +1,7 @@ #!/bin/bash run(){ - local script_dir=$(cd "$(dirname "$0")"; pwd) # 脚本文件绝对路径 + local script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/" # 脚本文件夹绝对路径 local config_dir=$(readlink -f "$script_dir/../conf") # 配置文件绝对路径 # 如果配置文件不存在或者空白 diff --git a/bin/update_port.sh b/bin/update_port.sh index 90b9ae1..44a2a83 100644 --- a/bin/update_port.sh +++ b/bin/update_port.sh @@ -45,7 +45,7 @@ find_free_port() { } update_port(){ - local script_dir=$(cd "$(dirname "$0")"; pwd) + local script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/ local config_dir="$script_dir/../conf" source "$script_dir/utils/jq_util.sh" @@ -54,4 +54,4 @@ update_port(){ echo "设置端口成功" } -update_port \ No newline at end of file +update_port diff --git a/install.sh b/install.sh index 5be2a3b..edd8eae 100644 --- a/install.sh +++ b/install.sh @@ -25,7 +25,7 @@ restart_docker() { # 安装依赖 install_dependencies(){ - local script_dir="$(cd "$(dirname "$0")"; pwd)/bin" # 脚本所在目录 + local script_dir=""$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)//bin" # 脚本所在目录 source "${script_dir}/utils/base.sh" if ! command -v curl >/dev/null 2>&1; then