put everything in a subshell
This commit is contained in:
parent
70d035c410
commit
9cb637facd
1 changed files with 4 additions and 6 deletions
10
blag
10
blag
|
@ -86,18 +86,16 @@ codeblock() {
|
||||||
printf '</code></pre>'
|
printf '</code></pre>'
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {(
|
||||||
local birth=$(stat -c'%W' "$1")
|
birth=$(stat -c'%W' "$1")
|
||||||
if (( birth > 0 )); then
|
if (( birth > 0 )); then
|
||||||
CREATED_AT=$(date --rfc-3339=seconds -d "@$birth")
|
CREATED_AT=$(date --rfc-3339=seconds -d "@$birth")
|
||||||
fi
|
fi
|
||||||
MODIFIED_AT=$(date --rfc-3339=seconds -d "@$(stat -c '%Y' "$1")")
|
MODIFIED_AT=$(date --rfc-3339=seconds -d "@$(stat -c '%Y' "$1")")
|
||||||
|
|
||||||
#shellcheck disable=SC1090
|
#shellcheck disable=SC1090
|
||||||
( . "$1"; ) # the moment you've all been waiting for
|
. "$1"
|
||||||
}
|
)}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
print_help() {
|
print_help() {
|
||||||
echo "Usage: $0 <SCRIPT>
|
echo "Usage: $0 <SCRIPT>
|
||||||
|
|
Loading…
Reference in a new issue