forked from raycast/script-commands
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbear-search.sh
executable file
·31 lines (28 loc) · 923 Bytes
/
bear-search.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash
# Install Bear via Mac App Store: https://apps.apple.com/us/app/bear/id1091189122
# @raycast.title Search
# @raycast.author Tanay Nistala
# @raycast.authorURL https://github.com/tanaynistala
# @raycast.description Search notes by keyword and/or tag in Bear.
#
# @raycast.icon images/bear-light.png
# @raycast.iconDark images/bear-dark.png
#
# @raycast.mode silent
# @raycast.packageName Bear
# @raycast.schemaVersion 1
# @raycast.argument1 { "type": "text", "placeholder": "Term", "optional": true, "percentEncoded": true}
# @raycast.argument2 { "type": "text", "placeholder": "Tag", "optional": true, "percentEncoded": true}
if [ ! -z "$1" ]; then
if [ ! -z "$2" ]; then
open "bear://x-callback-url/search?term=${1}&tag=${2}"
else
open "bear://x-callback-url/search?term=${1}"
fi
else
if [ ! -z "$2" ]; then
open "bear://x-callback-url/search?tag=${2}"
else
open "bear://"
fi
fi