mirror of
https://github.com/wimpysworld/stream-sprout
synced 2026-03-14 14:45:50 +01:00
feat(yaml): remove end of line comments
https://stackoverflow.com/questions/5014632/how-can-i-parse-a-yaml-file-from-a-linux-shell-script#comment119813940_21189044
This commit is contained in:
parent
a3d4e11ee5
commit
db233cde72
1 changed files with 1 additions and 0 deletions
|
|
@ -29,6 +29,7 @@ function parse_yaml() {
|
|||
if (length($3) > 0) {
|
||||
vn=""; for (i=0; i<indent; i++) {vn=(vn)(vname[i])("_")}
|
||||
gsub(/^[ \t]+/, "", $3); gsub(/[ \t]+$/, "", $3);
|
||||
gsub(/\s*#.*$/, "", $3);
|
||||
printf("%s%s%s=\"%s\"\n", "'"${prefix}"'",vn, $2, $3);
|
||||
}
|
||||
}'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue