X-Git-Url: https://git.plutz.net/?a=blobdiff_plain;f=attachment.sh;h=89b90ae2579a04dea091a01ac07de16f80454bb5;hb=f9cfcde441afed9d6db96e201935b6208903046d;hp=9b5d54590258c55d0115155ceb6dadf0dd60d908;hpb=1ceb1ca02e8cc1a55443152b8505e3949007ce54;p=shellwiki 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