You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
663 B
Plaintext
29 lines
663 B
Plaintext
1 year ago
|
#!/usr/bin/env bash
|
||
|
|
||
|
set -euo pipefail
|
||
|
|
||
|
# shellcheck disable=SC1091
|
||
|
source "${XDG_DATA_HOME}/buddy-up/includes/utils.sh"
|
||
|
|
||
|
APP=bws
|
||
|
VERSION=${VERSION:-0.3.0}
|
||
|
DEST=${XDG_DATA_HOME}/apps/releases/${APP}
|
||
|
|
||
|
main() (
|
||
|
URL=https://github.com/bitwarden/sdk/releases/download/bws-v${VERSION}/bws-$(uname -m)-$(get_os)-${VERSION}.zip
|
||
|
|
||
|
extract_zip "${URL}" "${DEST}/${VERSION}"
|
||
|
set_current_link "${DEST}" "${VERSION}"
|
||
|
set_link "${XDG_BIN_HOME}/${APP}" "${DEST}" "${APP}"
|
||
|
)
|
||
|
|
||
|
function get_os () {
|
||
|
case $(uname -s) in
|
||
|
Linux*) echo unknown-linux-gnu;;
|
||
|
Darwin*) echo apple-darwin;;
|
||
|
*) >&2 echo "unsupported os: $(uname -s)"; exit 1;;
|
||
|
esac
|
||
|
}
|
||
|
|
||
|
main "${@}"
|