shell: have, path_(append|prepend|remove)

- have: command -v shorthand
- path_append: appends dir to PATH
- path_prepend: prepends dir to PATH
- path_remove: removes dir from PATH
This commit is contained in:
2023-04-14 00:42:08 +03:00
parent 4492c386b6
commit e5d6cb37fd
15 changed files with 124 additions and 111 deletions

View File

@@ -1,8 +1,14 @@
#!/bin/bash
#!/usr/bin/env bash
#
# Install ntfy
#
# shellcheck source=shared.sh
source "$HOME/.dotfiles/scripts/shared.sh"
set -e
if ! command -v ntfy &> /dev/null; then
have ntfy && {
msg "ntfy already installed"
} || {
case $(dfm check arch) in
Linux)
NTFY_ARCH="linux_$(arch)"
@@ -28,6 +34,4 @@ if ! command -v ntfy &> /dev/null; then
fi
rm -rf "${NTFY_DEST}" "${NTFY_DEST}.tar.gz"
else
echo "ntfy already installed"
fi
}