From 733b523c5accece101977c8d62cb1a6d7bd606ee Mon Sep 17 00:00:00 2001 From: Richard Maw Date: Thu, 5 Aug 2021 19:32:27 +0100 Subject: fix: bash files implementations inability to read The template unpacks the embedded files into the datadir before the scendir is created and chdir'd into. Since dict_* assume that the files you want to read are in the current directory this makes them unreadable. Making them operate relative to datadir seemed like the least complicated solution, compared to copying them in or some kind of search path. --- share/bash/template/files.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'share') diff --git a/share/bash/template/files.sh b/share/bash/template/files.sh index 50c935d..e27bf0d 100644 --- a/share/bash/template/files.sh +++ b/share/bash/template/files.sh @@ -3,15 +3,16 @@ # Store files embedded in the markdown input. files_new() { - dict_new _files + rm -rf "$_datadir/_files" + mkdir "$_datadir/_files" } files_set() { - dict_set _files "$1" "$2" + printf "%s" "$2" >"$_datadir/_files/$1" } files_get() { - dict_get _files "$1" + cat "$_datadir/_files/$1" } -- cgit v1.2.1