Browse Source

Change default values as well as remove windows from available target

tags/v0.3.6-rc0
haixuanTao 1 year ago
parent
commit
20ae6f21a3
1 changed files with 14 additions and 7 deletions
  1. +14
    -7
      install.sh

+ 14
- 7
install.sh View File

@@ -23,10 +23,10 @@ FLAGS:
-f, --force Force overwriting an existing binary

OPTIONS:
--repo REPO Github Repository to install the binary from
--bin BIN Name of the binary to install
--tag TAG Tag (version) of the bin to install, defaults to latest release
--to LOCATION Where to install the binary [default: ~/.cargo/bin]
--repo REPO Github Repository to install the binary from [default: dora-rs]
--bin BIN Name of the binary to install [default: dora]
--tag TAG Tag (version) of the bin to install, defaults to latest release
--to LOCATION Where to install the binary [default: ~/.dora/bin]
--target TARGET
EOF
}
@@ -100,6 +100,14 @@ while test $# -gt 0; do
shift
done

if [ -z "${repo-}" ]; then
repo="dora-rs"
fi

if [ -z "${bin-}" ]; then
bin="dora"
fi

url=https://github.com/$repo/$bin
releases=$url/releases

@@ -120,9 +128,10 @@ if [ -z "${target-}" ]; then
fi

if [ -z "${dest-}" ]; then
dest="$HOME/.cargo/bin"
dest="$HOME/.dora/bin"
fi


if [ -z "${tag-}" ]; then
tag=$(
download https://api.github.com/repos/$repo/$bin/releases/latest - |
@@ -145,8 +154,6 @@ if [ -z "${target-}" ]; then
armv7l-Linux) target=armv7-unknown-linux-musleabihf;;
x86_64-Darwin) target=x86_64-apple-darwin;;
x86_64-Linux) target=x86_64-unknown-linux-gnu;;
x86_64-MINGW64_NT) target=x86_64-pc-windows-msvc;;
x86_64-Windows_NT) target=x86_64-pc-windows-msvc;;
*)
# shellcheck disable=SC2016
err 'Could not determine target from output of `uname -m`-`uname -s`, please use `--target`:' "$uname_target"


Loading…
Cancel
Save