Adds support for yaml files rather than yaml headers
This commit is contained in:
parent
d3803d9d33
commit
51ca57da7f
1 changed files with 8 additions and 2 deletions
10
inc/yaml
10
inc/yaml
|
@ -6,8 +6,14 @@ getYamlBlock(){
|
|||
local filename
|
||||
filename="$(findFile "$1")"
|
||||
|
||||
sed -n '1 { /^---/ { :a N; /\n---/! ba; p} }' "$filename" |
|
||||
sed '1d;$d;s/\t/ /g'
|
||||
# If there is a yaml file, use it
|
||||
# if not, try and get the yaml header
|
||||
if [ -f "$filename.yaml" ]; then
|
||||
cat "$filename.yaml"
|
||||
else
|
||||
sed -n '1 { /^---/ { :a N; /\n---/! ba; p} }' "$filename" |
|
||||
sed '1d;$d;s/\t/ /g'
|
||||
fi
|
||||
}
|
||||
|
||||
getYamlTitle(){
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue