From b7bcd4b3816ae79ebfb9c2b4c05b565e53681952 Mon Sep 17 00:00:00 2001 From: Jeremy Kaplan Date: Sat, 13 Mar 2021 18:38:16 -0800 Subject: [PATCH] bin: Ignore www subdomain in passget --- bin/passget | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/passget b/bin/passget index 74260c1..5776570 100755 --- a/bin/passget +++ b/bin/passget @@ -20,7 +20,7 @@ set -euo pipefail # "real" regexes! # # 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 }') if [ "${#matches[@]}" -eq 0 ]; then