]> git.plutz.net Git - shellwiki/commitdiff
make sure cache dir exists
authorPaul Hänsch <paul@plutz.net>
Thu, 21 Apr 2022 13:04:59 +0000 (15:04 +0200)
committerPaul Hänsch <paul@plutz.net>
Thu, 21 Apr 2022 13:04:59 +0000 (15:04 +0200)
attachment.sh

index 9b5d54590258c55d0115155ceb6dadf0dd60d908..89b90ae2579a04dea091a01ac07de16f80454bb5 100755 (executable)
@@ -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