We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0f01620 commit 97e7493Copy full SHA for 97e7493
.github/workflows/build-native-nuget.yml
@@ -136,8 +136,19 @@ jobs:
136
137
# ---------- 找到所有动态库 ----------
138
NUGET_LIB_DIR="${{ github.workspace }}/nuget"
139
- # find 出来的是全路径
140
- mapfile -t LIB_PATHS < <(find "$NUGET_LIB_DIR" -type f)
+
+ LIB_PATHS=()
141
142
+ if command -v mapfile >/dev/null 2>&1; then
143
+ # Bash ≥4(Linux runner)
144
+ mapfile -t LIB_PATHS < <(find "$NUGET_LIB_DIR" -type f -print)
145
+ else
146
+ # Bash 3.x(macOS runner)
147
+ while IFS= read -r -d '' f; do
148
+ LIB_PATHS+=("$f")
149
+ done < <(find "$NUGET_LIB_DIR" -type f -print0)
150
+ fi
151
152
if [ ${#LIB_PATHS[@]} -eq 0 ]; then
153
echo "Error: no native libs found in $NUGET_LIB_DIR"
154
exit 1
0 commit comments