Handle tmpfile in snippet
This commit is contained in:
parent
7181da294b
commit
c172cc4e67
4
snippy
4
snippy
@ -137,6 +137,10 @@ run() {
|
||||
elif grep -qE "^##noparse" "${snippets_directory}/${snippet}"; then
|
||||
content="$( tail -n +2 "${snippets_directory}/${snippet}" )"
|
||||
|
||||
# replace tmpfile for snippets with ##tmpfile header
|
||||
elif grep -qE "^##tmpfile" "${snippets_directory}/${snippet}"; then
|
||||
content="$( bashdown_simple <<< "$(tail -n +2 "${snippets_directory}/${snippet}" | sed "s%\$tmpfile%$tmpfile%g" )" )"
|
||||
|
||||
# execute bash script in scripts dir
|
||||
elif [[ $(dirname "${snippet}") == 'scripts' ]] && grep -qE "^#!/bin/bash" "${snippets_directory}/${snippet}"; then
|
||||
content="$( bash "${snippets_directory}/${snippet}" )"
|
||||
|
Loading…
Reference in New Issue
Block a user