From feb8ba75fb4944d8dd279e92472ffd7abec0b9b0 Mon Sep 17 00:00:00 2001 From: WuChang <3142324836@qq.com> Date: Wed, 31 Jul 2024 13:43:22 +0800 Subject: [PATCH] Fixed CI script path --- .github/workflows/build-artifacts.yml | 2 +- CIUtils/find-executable.sh | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-artifacts.yml b/.github/workflows/build-artifacts.yml index 3bfca8b..0a0502a 100644 --- a/.github/workflows/build-artifacts.yml +++ b/.github/workflows/build-artifacts.yml @@ -59,7 +59,7 @@ jobs: id: find-executable-files working-directory: ${{github.workspace}} run: | - chmod +x ./CIUtils/find-executable.sh + find ./CIUtils/ -name "*.sh" -exec chmod +x {} \; EXEC_FILES=$(./CIUtils/find-executable.sh "workspace/") echo "Found executable and dynamic library files: $EXEC_FILES" echo "exec_files=$EXEC_FILES" >> $GITHUB_OUTPUT diff --git a/CIUtils/find-executable.sh b/CIUtils/find-executable.sh index e6ddb4c..ff62f04 100644 --- a/CIUtils/find-executable.sh +++ b/CIUtils/find-executable.sh @@ -1,15 +1,18 @@ #!/bin/bash +# Get the directory of the current script +script_dir=$(dirname "$0") + # Detect the operating system os_type=$(uname) # Execute the corresponding script based on the operating system case "$os_type" in Linux) - echo $(./find-elf.sh "$1") + echo $("$script_dir/find-elf.sh" "$1") ;; Darwin) - echo $(./find-macho.sh "$1") + echo $("$script_dir/find-macho.sh" "$1") ;; *) echo "Unsupported OS: $os_type"