Skip to content

Commit 54759e2

Browse files
committed
Move package manager detection into install_package so we don't bail on macOS
1 parent e3e913f commit 54759e2

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

.github/workflows/scripts/install-and-build-with-sdk.sh

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -92,18 +92,17 @@ if [[ -n "$SWIFT_BUILD_FLAGS" ]]; then
9292
log "Additional build flags: $SWIFT_BUILD_FLAGS"
9393
fi
9494

95-
# Detect package manager
96-
if command -v apt >/dev/null 2>&1; then
97-
INSTALL_PACKAGE_COMMAND="apt update -q && apt install -yq"
98-
elif command -v dnf >/dev/null 2>&1; then
99-
INSTALL_PACKAGE_COMMAND="dnf install -y"
100-
elif command -v yum >/dev/null 2>&1; then
101-
INSTALL_PACKAGE_COMMAND="yum install -y"
102-
else
103-
fatal "No supported package manager found"
104-
fi
105-
10695
install_package() {
96+
# Detect package manager
97+
if command -v apt >/dev/null 2>&1; then
98+
INSTALL_PACKAGE_COMMAND="apt update -q && apt install -yq"
99+
elif command -v dnf >/dev/null 2>&1; then
100+
INSTALL_PACKAGE_COMMAND="dnf install -y"
101+
elif command -v yum >/dev/null 2>&1; then
102+
INSTALL_PACKAGE_COMMAND="yum install -y"
103+
else
104+
fatal "No supported package manager found"
105+
fi
107106
eval "$INSTALL_PACKAGE_COMMAND $1"
108107
}
109108

0 commit comments

Comments
 (0)