From 386f05bd7650a7db9c89deb8048ad036da986d31 Mon Sep 17 00:00:00 2001 From: 12345qiupeng Date: Mon, 17 Mar 2025 14:45:05 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E8=84=9A=E6=9C=AC?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=E8=8E=B7=E5=8F=96=E5=92=8C=E6=89=A7=E8=A1=8C?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- detection.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/detection.sh b/detection.sh index 115cd02..feb9949 100644 --- a/detection.sh +++ b/detection.sh @@ -1,7 +1,8 @@ #!/bin/sh - -# 获取当前脚本所在目录的绝对路径 -SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +# 使用 readlink -f 获取脚本的真实路径 +SCRIPT=$(readlink -f "$0") +SCRIPT_DIR=$(dirname "$SCRIPT") echo "脚本当前目录:$SCRIPT_DIR" -mono "$SCRIPT_DIR"/Release/BenzObstacleDetect.exe \ No newline at end of file +cd "$SCRIPT_DIR/Release" || { echo "进入 Release 文件夹失败"; exit 1; } +mono BenzObstacleDetect.exe \ No newline at end of file