summaryrefslogtreecommitdiff
path: root/zsh/functions/vault
blob: abe0158f8d2f92970956a26be2c3b4b7428e62e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# -*- mode: sh -*-

case $1 in
  close)
    hdiutil unmount -quiet $2
    ;;
  open)
    op get item ${2:t} --fields password --session $(op signin --raw) \
      | hdiutil attach -quiet -stdinpass $2
    ;;
  *)
    return 1
    ;;
esac