1
0
Fork 0

bin: Ignore www subdomain in passget

This commit is contained in:
Jeremy Kaplan 2021-03-13 18:38:16 -08:00
commit b7bcd4b381

View file

@ -20,7 +20,7 @@ set -euo pipefail
# "real" regexes! # "real" regexes!
# #
# shellcheck disable=SC2001 # shellcheck disable=SC2001
url=$(sed -E 's%https?://%%' <<< "$1") url=$(sed -E 's%https?://(www\.)?%%' <<< "$1")
mapfile -t matches < <(op list items | jq -c '.[] | select(.overview.url and (.overview.url | contains("'"${url}"'"))) | { uuid: .uuid, url: .overview.url, vault: .vaultUuid }') mapfile -t matches < <(op list items | jq -c '.[] | select(.overview.url and (.overview.url | contains("'"${url}"'"))) | { uuid: .uuid, url: .overview.url, vault: .vaultUuid }')
if [ "${#matches[@]}" -eq 0 ]; then if [ "${#matches[@]}" -eq 0 ]; then