Last active
March 13, 2021 21:36
-
-
Save grantmacken/4a80f565612fcd6d0eb5 to your computer and use it in GitHub Desktop.
extract front-matter from a markdown file into vars
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
ISSUE_DATE=2015-01-14 | |
ISSUE_LABEL="enhancement" | |
ISSUE_TITLE="branch selection from issue" | |
ISSUE_STATE="open" | |
ISSUE_NUMBER=2 | |
--- | |
A one line *summary* of what we hope to resolve. | |
- [x] todo task 1 | |
- [ ] todo task 2 | |
- [ ] todo ... | |
enhancement #2 branch selection from issue |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
file='issue.txt' | |
source <(cat << EOF | |
$( sed -n '1,/---/p' ${file} | sed '1d;$d' ) | |
EOF | |
) | |
echo " *ISSUE_DATE*: [ ${ISSUE_DATE} ]" | |
echo " *ISSUE_TITLE*: [ ${ISSUE_TITLE} ]" | |
echo " *ISSUE_LABEL*: [ ${ISSUE_LABEL} ]" | |
echo " *ISSUE_NUMBER*: [ ${ISSUE_NUMBER} ]" | |
echo " *ISSUE_STATE*: [ ${ISSUE_STATE} ]" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
view issue.md in the raw