Skip to content

Commit afccb1e

Browse files
committed
Fix setup.sh to be POSIX-compatible (sh)
1 parent 2b952d4 commit afccb1e

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

setup.sh

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/bin/sh
22
#
33
# maestro-ios-device setup script
44
# Downloads the correct binary and runs setup
@@ -25,9 +25,9 @@ echo "║ Built by DeviceLab — https://devicelab.dev ║"
2525
echo "╚════════════════════════════════════════════════════════════════╝"
2626
echo ""
2727

28-
read -p "Continue with installation? [y/N] " -n 1 -r
29-
echo
30-
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
28+
printf "Continue with installation? [y/N] "
29+
read -r REPLY
30+
if [ "$REPLY" != "y" ] && [ "$REPLY" != "Y" ]; then
3131
echo "Installation cancelled."
3232
exit 1
3333
fi
@@ -37,7 +37,7 @@ echo ""
3737
# Check OS
3838
OS=$(uname -s)
3939
if [ "$OS" != "Darwin" ]; then
40-
echo -e "${RED}Error: Only macOS is supported${NC}"
40+
printf "${RED}Error: Only macOS is supported${NC}\n"
4141
exit 1
4242
fi
4343

@@ -51,7 +51,7 @@ case $ARCH in
5151
ARCH="arm64"
5252
;;
5353
*)
54-
echo -e "${RED}Error: Unsupported architecture: $ARCH${NC}"
54+
printf "${RED}Error: Unsupported architecture: $ARCH${NC}\n"
5555
exit 1
5656
;;
5757
esac
@@ -65,7 +65,7 @@ echo ""
6565
# Find where maestro is installed
6666
MAESTRO_PATH=$(which maestro 2>/dev/null || true)
6767
if [ -z "$MAESTRO_PATH" ]; then
68-
echo -e "${RED}Error: Maestro not found in PATH. Install Maestro first: https://maestro.mobile.dev${NC}"
68+
printf "${RED}Error: Maestro not found in PATH. Install Maestro first: https://maestro.mobile.dev${NC}\n"
6969
exit 1
7070
fi
7171

@@ -77,7 +77,7 @@ echo ""
7777
echo "📥 Downloading ${BINARY}..."
7878
TMP_FILE=$(mktemp)
7979
if ! curl -fsSL "$DOWNLOAD_URL" -o "$TMP_FILE"; then
80-
echo -e "${RED}Error: Failed to download binary${NC}"
80+
printf "${RED}Error: Failed to download binary${NC}\n"
8181
echo "URL: $DOWNLOAD_URL"
8282
rm -f "$TMP_FILE"
8383
exit 1
@@ -88,7 +88,7 @@ echo "📦 Installing to $INSTALL_DIR/$BINARY_NAME..."
8888
mv "$TMP_FILE" "$INSTALL_DIR/$BINARY_NAME"
8989
chmod +x "$INSTALL_DIR/$BINARY_NAME"
9090

91-
echo -e "${GREEN}✅ Binary installed${NC}"
91+
printf "${GREEN}✅ Binary installed${NC}\n"
9292
echo ""
9393

9494
# Run setup command
@@ -97,4 +97,4 @@ echo ""
9797
"$INSTALL_DIR/$BINARY_NAME" setup
9898

9999
echo ""
100-
echo -e "${GREEN}✅ Installation complete!${NC}"
100+
printf "${GREEN}✅ Installation complete!${NC}\n"

0 commit comments

Comments
 (0)