Skip to content

Commit

Permalink
Fix filename generation for many platforms in bootstrap scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
autarch committed Oct 27, 2024
1 parent d19b055 commit 5f5fcf3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion bootstrap/bootstrap-ubi.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$Filename = "ubi-Windows-x86_64.zip"
$Filename = "ubi-Windows-msvc-x86_64.zip"

$URL = "https://github.com/houseabsolute/ubi/releases/latest/download/$($Filename)"

Expand Down
14 changes: 9 additions & 5 deletions bootstrap/bootstrap-ubi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ if [ -z "$FILENAME" ]; then
OS="Linux"
;;
Darwin)
OS="Darwin"
OS="macOS"
;;
FreeBSD)
OS="FreeBSD"
Expand All @@ -40,6 +40,7 @@ if [ -z "$FILENAME" ]; then
;;
MINGW*)
OS="Windows"
LIBC="-msvc"
EXT="zip"
;;
*)
Expand All @@ -54,7 +55,7 @@ if [ -z "$FILENAME" ]; then
ARCH=$(uname -m)
case "$ARCH" in
i386 | i486 | i586 | i686)
CPU="i786"
CPU="i686"
if [ "$OS" = "Linux" ]; then
LIBC="-musl"
fi
Expand All @@ -68,11 +69,11 @@ if [ -z "$FILENAME" ]; then
arm | armv5* | armv6* | armv7*)
CPU="arm"
if [ "$OS" = "Linux" ]; then
LIBC="-musl"
LIBC="-musleabi"
fi
;;
aarch64 | arm64)
CPU="aarch64"
CPU="arm64"
if [ "$OS" = "Linux" ]; then
LIBC="-musl"
fi
Expand Down Expand Up @@ -103,6 +104,9 @@ if [ -z "$FILENAME" ]; then
;;
powerpc64le | ppc64le)
CPU="powerpc64le"
if [ "$OS" = "Linux" ]; then
LIBC="-gnu"
fi
;;
riscv64 | rv64gc)
CPU="riscv64gc"
Expand All @@ -122,7 +126,7 @@ if [ -z "$FILENAME" ]; then
;;
esac

FILENAME="ubi-$OS-$CPU$LIBC.$EXT"
FILENAME="ubi-$OS$LIBC-$CPU.$EXT"
fi

if [ -z "$TAG" ]; then
Expand Down

0 comments on commit 5f5fcf3

Please sign in to comment.