]> git.plutz.net Git - lobster/commitdiff
make loading prescrition file optional
authorPaul Hänsch <paul@plutz.net>
Wed, 5 Aug 2020 14:17:31 +0000 (16:17 +0200)
committerPaul Hänsch <paul@plutz.net>
Wed, 5 Aug 2020 14:17:31 +0000 (16:17 +0200)
therapies/index.cgi

index 6284c0033f504e53422e5c09cedade5fb4598811..515f2b0265308042562f291f0a93a61ad7af6d2f 100755 (executable)
@@ -58,7 +58,7 @@ mpxfile="${_DATA}/prescriptions/${id}.mpx"
 tpyfile="${_DATA}/therapies/${id}.tpy"
 
 vcf="$(pdi_load "$vcffile")"
-mpx="$(sed '1s;^;\n;; s/:/;:/' "$mpxfile")"
+mpx="$([ -f "$mpxfile" ] && sed '1s;^;\n;; s/:/;:/' "$mpxfile")"
 tpy="$(sed '1s;^;\n;; s/:/;:/' "$tpyfile")"
 
 VCF(){ pdi_value "$vcf" "$@"; }