Skip to content

Commit c99c88b

Browse files
fix(taskfile): make android:setup idempotent
Check if NDK directory exists before running sdkmanager to avoid SIGPIPE (exit 141) when NDK is already installed. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent e560ac6 commit c99c88b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

taskfiles/android.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,13 @@ tasks:
3737
brew list "$pkg" &>/dev/null || brew install "$pkg"
3838
done
3939
- |
40-
echo "Installing Android NDK..."
41-
yes | sdkmanager --install "ndk;28.2.13676358"
40+
NDK_DIR="{{.ANDROID_HOME}}/ndk/28.2.13676358"
41+
if [ -d "$NDK_DIR" ]; then
42+
echo "Android NDK already installed at $NDK_DIR"
43+
else
44+
echo "Installing Android NDK..."
45+
yes | sdkmanager --install "ndk;28.2.13676358"
46+
fi
4247
- |
4348
echo "Adding Android Rust targets..."
4449
rustup target add {{.ANDROID_ARM64_TARGET}} {{.ANDROID_ARMV7_TARGET}} {{.ANDROID_X86_TARGET}} {{.ANDROID_X64_TARGET}}

0 commit comments

Comments
 (0)