You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
444 B
25 lines
444 B
4 years ago
|
#!/usr/bin/env bash
|
||
|
|
||
|
getYamlBlock(){
|
||
|
vecho "getYamlBlock $*"
|
||
|
cd "$dataDir" || return
|
||
|
local filename
|
||
|
filename="$(findFile "$1")"
|
||
|
|
||
|
sed -n '1 { /^---/ { :a N; /\n---/! ba; p} }' "$filename" |
|
||
|
sed '1d;$d;s/\t/ /g'
|
||
|
}
|
||
|
|
||
|
getYamlTitle(){
|
||
|
vecho "getYamlTitle $*"
|
||
|
cd "$dataDir" || return
|
||
|
getYamlBlock "$1" | yq -r '.Title'
|
||
|
}
|
||
|
|
||
|
getYamlTags(){
|
||
|
vecho "getYamlTitle $*"
|
||
|
cd "$dataDir" || return
|
||
|
getYamlBlock "$1" | yq -r '.Tags | join("\n")'
|
||
|
}
|
||
|
|