Skip to content

Commit b783006

Browse files
kate-goldenringitowlson
authored andcommitted
Skip installing plugins for musl OS and remove redundant linux-gnu check
Signed-off-by: Kate Goldenring <[email protected]>
1 parent 4de1102 commit b783006

File tree

1 file changed

+20
-17
lines changed

1 file changed

+20
-17
lines changed

downloads/install.sh

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,6 @@ if command -v ldd >/dev/null 2>&1 && [[ "$(ldd /bin/ls | grep -m1 'musl')" ]]; t
9696
fi
9797

9898
case $OSTYPE in
99-
"linux-gnu"*)
100-
OS="linux"
101-
STATIC="false"
102-
;;
10399
"darwin"*)
104100
OS="macos"
105101
STATIC="false"
@@ -120,8 +116,8 @@ case $OSTYPE in
120116
esac
121117

122118
# Check desired version. Default to latest if no desired version was requested
123-
if [[ $VERSION = "" ]]; then
124-
VERSION=$(curl -so- https://github.com/spinframework/spin/releases | grep 'href="/fermyon/spin/releases/tag/v[0-9]*.[0-9]*.[0-9]*\"' | sed -E 's/.*\/fermyon\/spin\/releases\/tag\/(v[0-9\.]+)".*/\1/g' | head -1)
119+
if [[ -z $VERSION ]]; then
120+
VERSION=$(curl -so- https://github.com/spinframework/spin/releases | grep 'href="/spinframework/spin/releases/tag/v[0-9]*.[0-9]*.[0-9]*\"' | sed -E 's/.*\/spinframework\/spin\/releases\/tag\/(v[0-9\.]+)".*/\1/g' | head -1)
125121
fi
126122

127123
# Constructing download FILE and URL
@@ -145,7 +141,10 @@ fi
145141

146142
# Download file, exit if not found - e.g. version does not exist
147143
fancy_print 0 "Step 1: Downloading: ${URL}"
148-
curl -fsOL $URL || (fancy_print 1 "Error downloading the file: ${FILE}"; exit 1)
144+
curl -fsOL $URL || (
145+
fancy_print 1 "Error downloading the file: ${FILE}"
146+
exit 1
147+
)
149148
fancy_print 0 "Done...\n"
150149

151150
# Decompress the file
@@ -165,17 +164,21 @@ fancy_print 0 "Step 4: Installing default templates"
165164
./spin templates install --git "https://github.com/spinframework/spin-python-sdk" --upgrade
166165
./spin templates install --git "https://github.com/spinframework/spin-js-sdk" --upgrade
167166

168-
fancy_print 0 "Step 5: Installing default plugins"
169-
./spin plugins update
170-
if [[ $VERSION = "canary" ]]; then
171-
./spin plugins install -u https://github.com/fermyon/cloud-plugin/releases/download/canary/cloud.json --yes
172-
else
173-
./spin plugins install cloud --yes
174-
fi
167+
if [[ $STATIC = "false" ]]; then
168+
fancy_print 0 "Step 5: Installing default plugins"
169+
./spin plugins update
170+
if [[ $VERSION = "canary" ]]; then
171+
./spin plugins install -u https://github.com/fermyon/cloud-plugin/releases/download/canary/cloud.json --yes
172+
else
173+
./spin plugins install cloud --yes
174+
fi
175175

176-
if [[ $VERSION = "canary" ]]; then
177-
fancy_print 3 "Warning: You are using canary Spin, but templates use latest stable SDKs."
178-
fancy_print 3 "Be sure to update templates to point to 'canary' SDKs."
176+
if [[ $VERSION = "canary" ]]; then
177+
fancy_print 3 "Warning: You are using canary Spin, but templates use latest stable SDKs."
178+
fancy_print 3 "Be sure to update templates to point to 'canary' SDKs."
179+
fi
180+
else
181+
fancy_print 0 "Step 5: Skipping plugin installation for OS with musl"
179182
fi
180183
# Direct to quicks-start doc
181184
fancy_print 0 "You're good to go. Check here for the next steps: https://spinframework.dev/quickstart"

0 commit comments

Comments
 (0)