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
6
inc/yaml
6
inc/yaml
|
@ -6,8 +6,14 @@ getYamlBlock(){
|
||||||
local filename
|
local filename
|
||||||
filename="$(findFile "$1")"
|
filename="$(findFile "$1")"
|
||||||
|
|
||||||
|
# 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 -n '1 { /^---/ { :a N; /\n---/! ba; p} }' "$filename" |
|
||||||
sed '1d;$d;s/\t/ /g'
|
sed '1d;$d;s/\t/ /g'
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
getYamlTitle(){
|
getYamlTitle(){
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue