CLI self-updater, warn on version mismatch, direct install.sh option, androidmanifest and info.plist customization, bump to 0.7-alpha.0 (#4095)
* wip.... bun installer * - warn on incompatible versions - clean up some logs - add coloring to log levels * add toasts to desktop/mobile * Auto open simulators * auto boot android * preserve url * pull out some of the warnings * add self-updater * wip: mcp * add install.sh and adjust binstall path * add some cuter styling to logs! * update "input.css" * update other input.css * style a bit more * change getting started * add windows installer * move dioxus-mobile into dioxus-desktop add sentry wip to cli * shorten timeout of toast * fix cli display * wire up customization of android manifest * udid is a real word * add 429 to lychee cache * accept all 200-204 and 429
This commit is contained in:
1 parent
53ef78823d
commit
4d3d55a7a3
56 files changed
+1560
-548
No files matched your search
Executable
+104
@@ -0,0 +1,104 @@
|
||||
#!/bin/sh
|
||||
set -eo pipefail
|
||||
|
||||
# Reset
|
||||
Color_Off=''
|
||||
|
||||
# Regular Colors
|
||||
Red=''
|
||||
Green=''
|
||||
Dim='' # White
|
||||
|
||||
# Bold
|
||||
Bold_White=''
|
||||
Bold_Green=''
|
||||
|
||||
if [[ -t 1 ]]; then
|
||||
# Reset
|
||||
Color_Off='\033[0m' # Text Reset
|
||||
|
||||
# Regular Colors
|
||||
Red='\033[0;31m' # Red
|
||||
Green='\033[0;32m' # Green
|
||||
Dim='\033[0;2m' # White
|
||||
|
||||
# Bold
|
||||
Bold_Green='\033[1;32m' # Bold Green
|
||||
Bold_White='\033[1m' # Bold White
|
||||
fi
|
||||
|
||||
error() {
|
||||
echo -e "${Red}error${Color_Off}:" "$@" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
info() {
|
||||
echo -e "${Dim}$@ ${Color_Off}"
|
||||
}
|
||||
|
||||
info_bold() {
|
||||
echo -e "${Bold_White}$@ ${Color_Off}"
|
||||
}
|
||||
|
||||
success() {
|
||||
echo -e "${Green}$@ ${Color_Off}"
|
||||
}
|
||||
|
||||
command -v unzip >/dev/null ||
|
||||
error 'unzip is required to install dx'
|
||||
|
||||
if [[ $# -gt 1 ]]; then
|
||||
error 'Too many arguments, only 1 are allowed. The first can be a specific tag of dx to install. (e.g. "dx-v0.7.1")'
|
||||
fi
|
||||
|
||||
if [ "$OS" = "Windows_NT" ]; then
|
||||
target="x86_64-pc-windows-msvc"
|
||||
else
|
||||
case $(uname -sm) in
|
||||
"Darwin x86_64") target="x86_64-apple-darwin" ;;
|
||||
"Darwin arm64") target="aarch64-apple-darwin" ;;
|
||||
"Linux aarch64") target="aarch64-unknown-linux-gnu" ;;
|
||||
*) target="x86_64-unknown-linux-gnu" ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
GITHUB=${GITHUB-"https://github.com"}
|
||||
github_repo="$GITHUB/dioxuslabs/dioxus"
|
||||
exe_name=dx
|
||||
|
||||
if [[ $# = 0 ]]; then
|
||||
dx_uri=$github_repo/releases/latest/download/dx-$target.zip
|
||||
else
|
||||
dx_uri=$github_repo/releases/download/$1/dx-$target.zip
|
||||
fi
|
||||
|
||||
dx_install="${DX_INSTALL:-$HOME/.dx}"
|
||||
bin_dir="$dx_install/bin"
|
||||
exe="$bin_dir/dx"
|
||||
cargo_bin_dir="$HOME/.cargo/bin"
|
||||
cargo_bin_exe="$cargo_bin_dir/dx"
|
||||
|
||||
if [ ! -d "$bin_dir" ]; then
|
||||
mkdir -p "$bin_dir"
|
||||
fi
|
||||
|
||||
curl --fail --location --progress-bar --output "$exe.zip" "$dx_uri"
|
||||
if command -v unzip >/dev/null; then
|
||||
unzip -d "$bin_dir" -o "$exe.zip"
|
||||
else
|
||||
7z x -o"$bin_dir" -y "$exe.zip"
|
||||
fi
|
||||
chmod +x "$exe"
|
||||
cp "$exe" "$cargo_bin_exe" || error "Failed to copy dx to $cargo_bin_dir"
|
||||
rm "$exe.zip"
|
||||
echo " installed: $cargo_bin_exe"
|
||||
|
||||
echo
|
||||
echo "dx was installed successfully! 💫"
|
||||
echo
|
||||
|
||||
if command -v dx >/dev/null; then
|
||||
echo "Run 'dx --help' to get started"
|
||||
else
|
||||
echo "Run '$exe --help' to get started"
|
||||
fi
|
||||
Reference in new issue
Block a user