From: Paul Hänsch Date: Thu, 21 Apr 2022 13:04:59 +0000 (+0200) Subject: make sure cache dir exists X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=1ab03a82dd44b590f696045747068aea373d5bf8;p=shellwiki make sure cache dir exists --- diff --git a/attachment.sh b/attachment.sh index 9b5d545..89b90ae 100755 --- a/attachment.sh +++ b/attachment.sh @@ -17,7 +17,7 @@ attachment_convert(){ elif [ -f "$cachepath" ]; then printf %s "$attpath" return 0 - elif ! touch "$cachepath"; then + elif ! mkdir -p -- "${cachepath%/*}" && touch "$cachepath"; then printf %s "$attpath" return 0 fi