blob: 1a04c8222e995d3e8260fb52dc3002ab4fc3d699 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
function shownote() {
NOTE=$1
# shellcheck disable=SC2155
local OK=$(check_noteID "$NOTE")
if [ ! "$OK" ]; then
echo "invalid note \"$NOTE\""
echo "Use the note ID that you can fetch after listing your notes"
exit 1
fi
FILE=$($JQ -r --arg i $OK '.notes[] | select(.id == $i) | .file' $DB)
if [ "$FILE" ]; then
$PAGER ${NOTESDIR}/${FILE}
fi
}
|