fix: make install.sh sh compatible (#5058)

This commit is contained in:
Jonathan Kelley authored and GitHub committed 2025-12-05 12:12:11 -08:00
1 parent dd2d1b8a19
commit c5f330dcae
1 file changed
+7 -7
+7 -7
View File
@@ -13,7 +13,7 @@ Dim='' # White
Bold_White=''
Bold_Green=''
if [[ -t 1 ]]; then
if [ -t 1 ]; then
# Reset
Color_Off='\033[0m' # Text Reset
@@ -28,26 +28,26 @@ if [[ -t 1 ]]; then
fi
error() {
echo -e "${Red}error${Color_Off}:" "$@" >&2
printf "${Red}error${Color_Off}: %s\n" "$*" >&2
exit 1
}
info() {
echo -e "${Dim}$@ ${Color_Off}"
printf "${Dim}%s ${Color_Off}\n" "$*"
}
info_bold() {
echo -e "${Bold_White}$@ ${Color_Off}"
printf "${Bold_White}%s ${Color_Off}\n" "$*"
}
success() {
echo -e "${Green}$@ ${Color_Off}"
printf "${Green}%s ${Color_Off}\n" "$*"
}
command -v unzip >/dev/null ||
error 'unzip is required to install dx'
if [[ $# -gt 2 ]]; then
if [ $# -gt 2 ]; then
error 'Too many arguments, only 2 are allowed. The first can be a specific tag of dx to install. (e.g. "dx-v0.7.1") or `nightly` or `pr <PR_NUMBER>` to install the latest nightly or PR build.'
fi
@@ -78,7 +78,7 @@ GITHUB=${GITHUB-"https://github.com"}
github_repo="$GITHUB/dioxuslabs/dioxus"
exe_name=dx
if [[ $# = 0 ]]; then
if [ $# = 0 ]; then
dx_uri=$github_repo/releases/latest/download/dx-$target.zip
else
dx_uri=$github_repo/releases/download/$1/dx-$target.zip