File tree Expand file tree Collapse file tree 1 file changed +24
-4
lines changed Expand file tree Collapse file tree 1 file changed +24
-4
lines changed Original file line number Diff line number Diff line change @@ -89,12 +89,28 @@ case $UNAME_ARC in
8989 ;;
9090esac
9191
92+ # If OS uses musl, set distinct OS type to ensure the binary
93+ # with statically linked libraries and dependencies is used
94+ if command -v ldd > /dev/null 2>&1 && [[ " $( ldd /bin/ls | grep -m1 ' musl' ) " ]]; then
95+ OSTYPE=" linux-musl"
96+ fi
97+
9298case $OSTYPE in
9399" linux-gnu" * )
94100 OS=" linux"
101+ STATIC=" false"
95102 ;;
96103" darwin" * )
97104 OS=" macos"
105+ STATIC=" false"
106+ ;;
107+ " linux-musl" * )
108+ OS=" linux"
109+ STATIC=" true"
110+ ;;
111+ " linux" * )
112+ OS=" linux"
113+ STATIC=" false"
98114 ;;
99115* )
100116 fancy_print 1 " The OSTYPE: ${OSTYPE} is not supported by this script."
@@ -109,17 +125,21 @@ if [[ $VERSION = "" ]]; then
109125fi
110126
111127# Constructing download FILE and URL
112- FILE=" spin-${VERSION} -${OS} -${ARC} .tar.gz"
128+ if [[ $STATIC = " true" ]]; then
129+ FILE=" spin-${VERSION} -static-${OS} -${ARC} .tar.gz"
130+ else
131+ FILE=" spin-${VERSION} -${OS} -${ARC} .tar.gz"
132+ fi
113133URL=" https://github.com/spinframework/spin/releases/download/${VERSION} /${FILE} "
114134
115135# Establish the location of current working environment
116136current_dir=$( pwd)
117137
118138# Define Spin directory name
119- spin_directory_name=( " /spin" )
139+ spin_directory_name=" /spin"
120140
121- if [ -d " ${current_dir}${ spin_directory_name} " ]; then
122- fancy_print 1 " Error: .${ spin_directory_name} already exists, please delete ${current_dir}${ spin_directory_name} and run the installer again."
141+ if [ -d " ${current_dir} $spin_directory_name " ]; then
142+ fancy_print 1 " Error: .$spin_directory_name already exists, please delete ${current_dir} $spin_directory_name and run the installer again."
123143 exit 1
124144fi
125145
You can’t perform that action at this time.
0 commit comments