bin: passget handle URLs with schemes
This commit is contained in:
parent
ba78b5282f
commit
6d7bb763dd
1 changed files with 5 additions and 1 deletions
|
|
@ -16,7 +16,11 @@ set -euo pipefail
|
|||
|
||||
# TODO: Print vault name instead of ID
|
||||
|
||||
url="$1"
|
||||
# This cannot be done easily with simple replacement. It actually needed
|
||||
# "real" regexes!
|
||||
#
|
||||
# shellcheck disable=SC2001
|
||||
url=$(sed -E 's%https?://%%' <<< "$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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue