Document one-line upgrade via install.sh re-run
Clarify that re-running the curl installer upgrades in place, and detect an existing install so the script prints an Updating message. Co-authored-by: Frank Vitrano <WHC2006@users.noreply.github.com>
This commit is contained in:
co-authored by
Frank Vitrano
parent
a4f4767c47
commit
7380d7c4b8
@@ -26,6 +26,26 @@ Install for the current user under `~/.local`:
|
|||||||
|
|
||||||
The installer adds the required packages automatically: `base-devel`, `git`, `curl`, and `jq`.
|
The installer adds the required packages automatically: `base-devel`, `git`, `curl`, and `jq`.
|
||||||
|
|
||||||
|
## Upgrade
|
||||||
|
|
||||||
|
Already installed (preferred):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
miaur self-update --noconfirm
|
||||||
|
```
|
||||||
|
|
||||||
|
One-line reinstall from GitHub (same as install; overwrites the current prefix):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
bash <(curl -fsSL https://raw.githubusercontent.com/WHC2006/miaur/main/install.sh)
|
||||||
|
```
|
||||||
|
|
||||||
|
User install:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
bash <(curl -fsSL https://raw.githubusercontent.com/WHC2006/miaur/main/install.sh) --user
|
||||||
|
```
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|||||||
+9
-3
@@ -22,9 +22,11 @@ for arg in "$@"; do
|
|||||||
cat <<'EOF'
|
cat <<'EOF'
|
||||||
Usage: install.sh [--user] [--uninstall]
|
Usage: install.sh [--user] [--uninstall]
|
||||||
|
|
||||||
(default) Install system-wide to /usr/local (needs sudo)
|
(default) Install or upgrade system-wide to /usr/local (needs sudo)
|
||||||
--user Install to ~/.local (no sudo for the link)
|
--user Install or upgrade to ~/.local (no sudo for the link)
|
||||||
--uninstall Remove installed miaur
|
--uninstall Remove installed miaur
|
||||||
|
|
||||||
|
Re-running this script upgrades an existing install in place.
|
||||||
EOF
|
EOF
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
@@ -108,7 +110,11 @@ do_install() {
|
|||||||
|
|
||||||
[[ -f $SRC/miaur && -d $SRC/lib ]] || die "incomplete source tree: $SRC"
|
[[ -f $SRC/miaur && -d $SRC/lib ]] || die "incomplete source tree: $SRC"
|
||||||
|
|
||||||
echo "==> Installing to ${SHARE_DIR}"
|
if [[ -e $BIN_LINK || -d $SHARE_DIR ]]; then
|
||||||
|
echo "==> Updating existing install at ${SHARE_DIR}"
|
||||||
|
else
|
||||||
|
echo "==> Installing to ${SHARE_DIR}"
|
||||||
|
fi
|
||||||
$SUDO mkdir -p "$SHARE_DIR" "${PREFIX}/bin"
|
$SUDO mkdir -p "$SHARE_DIR" "${PREFIX}/bin"
|
||||||
$SUDO rm -rf "$SHARE_DIR"
|
$SUDO rm -rf "$SHARE_DIR"
|
||||||
$SUDO mkdir -p "$SHARE_DIR"
|
$SUDO mkdir -p "$SHARE_DIR"
|
||||||
|
|||||||
Reference in New Issue
Block a user