mirror of
https://github.com/webinstall/webi-installers.git
synced 2026-03-03 18:00:18 +00:00
36 lines
865 B
Bash
36 lines
865 B
Bash
#!/bin/bash
|
|
set -e
|
|
set -u
|
|
|
|
function __install_gpg_pubkey() {
|
|
MY_CMD="gpg-pubkey"
|
|
|
|
rm -f "$HOME/.local/bin/$MY_CMD"
|
|
webi_download "$WEBI_HOST/packages/$MY_CMD/$MY_CMD.sh" "$HOME/.local/bin/$MY_CMD"
|
|
chmod a+x "$HOME/.local/bin/$MY_CMD"
|
|
}
|
|
|
|
function __install_gpg_pubkey_id() {
|
|
MY_CMD="gpg-pubkey"
|
|
MY_SUBCMD="gpg-pubkey-id"
|
|
|
|
rm -f "$HOME/.local/bin/$MY_SUBCMD"
|
|
webi_download "$WEBI_HOST/packages/$MY_CMD/$MY_SUBCMD.sh" "$HOME/.local/bin/$MY_SUBCMD"
|
|
chmod a+x "$HOME/.local/bin/$MY_SUBCMD"
|
|
}
|
|
|
|
function __check_gpg_exists() {
|
|
if ! command -v gpg; then
|
|
webi gpg
|
|
export PATH="$HOME/.local/opt/gnupg/bin:$PATH"
|
|
export PATH="$HOME/.local/opt/gnupg/bin/pinentry-mac.app/Contents/MacOS:$PATH"
|
|
fi
|
|
}
|
|
|
|
__install_gpg_pubkey_id
|
|
__install_gpg_pubkey
|
|
__check_gpg_exists
|
|
|
|
# run the command
|
|
"$HOME/.local/bin/$MY_CMD"
|