From 9cb637facd738d001b90c2c71a544018ef46c1aa Mon Sep 17 00:00:00 2001 From: slonkazoid Date: Thu, 26 Dec 2024 20:14:12 +0300 Subject: [PATCH] put everything in a subshell --- blag | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/blag b/blag index 915463c..3cb7cf8 100755 --- a/blag +++ b/blag @@ -86,18 +86,16 @@ codeblock() { printf '' } -render() { - local birth=$(stat -c'%W' "$1") +render() {( + birth=$(stat -c'%W' "$1") if (( birth > 0 )); then CREATED_AT=$(date --rfc-3339=seconds -d "@$birth") fi MODIFIED_AT=$(date --rfc-3339=seconds -d "@$(stat -c '%Y' "$1")") #shellcheck disable=SC1090 - ( . "$1"; ) # the moment you've all been waiting for -} - - + . "$1" +)} print_help() { echo "Usage: $0