From 60dc388ede89783c6bee1426d447bb0664352c3c Mon Sep 17 00:00:00 2001 From: Iain Beeston Date: Wed, 26 Feb 2025 16:53:19 +0000 Subject: [PATCH] Support bash 3 in local builds When testing an android app with maestro, the bash script that's generated relies the globstar option. This is only available on bash 4 or higher but mac os only comes with bash 3 (and will probably never move to bash 4 or 5 because they use the gplv3 license). Because of this if you run `eas -p android --local` on a mac the build will fail with this error (if the build runs maestro): shopt: globstar: invalid shell option name To resolve this and support bash 3 I've refactored the maestro test code to use `find` rather than globstar, which should make it possible to run local builds on mac. --- .../build-tools/src/steps/functionGroups/maestroTest.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/build-tools/src/steps/functionGroups/maestroTest.ts b/packages/build-tools/src/steps/functionGroups/maestroTest.ts index 1d12fd1d3..315e13cbb 100644 --- a/packages/build-tools/src/steps/functionGroups/maestroTest.ts +++ b/packages/build-tools/src/steps/functionGroups/maestroTest.ts @@ -91,16 +91,16 @@ export function createEasMaestroTestFunctionGroup( name: 'install_app', displayName: `Install app to Emulator`, command: ` - # shopt -s globstar is necessary to add /**/ support - shopt -s globstar # shopt -s nullglob is necessary not to try to install # SEARCH_PATH literally if there are no matching files. shopt -s nullglob SEARCH_PATH="${searchPath}" + SEARCH_DIR=\${SEARCH_PATH%"*/"*} + BASENAME=\${SEARCH_PATH##*/} FILES_FOUND=false - for APP_PATH in $SEARCH_PATH; do + for APP_PATH in $(find $SEARCH_DIR -name "$BASENAME"); do FILES_FOUND=true echo "Installing \\"$APP_PATH\\"" adb install "$APP_PATH"