Browse Source

Fix error when submitting without altname

Alois Mahdal 6 years ago
parent
commit
f5fe5920f6
1 changed files with 5 additions and 4 deletions
  1. 5
    4
      src/jat.sh.skel

+ 5
- 4
src/jat.sh.skel View File

745
         __jat__usage "no SRC?"
745
         __jat__usage "no SRC?"
746
         return 2
746
         return 2
747
     }
747
     }
748
+    mkdir -p "$dest" || {
749
+        jat__log_error "cannot write to result storage: $dest"
750
+        return 3
751
+    }
748
     test -n "$altname" && {
752
     test -n "$altname" && {
749
         dest="$dest/$altname"
753
         dest="$dest/$altname"
750
         nhint=" as $altname"
754
         nhint=" as $altname"
751
-    }
752
-    mkdir -p "$(dirname "$dest")" || {
753
-        jat__log_error "cannot write to result storage: $dest"
754
-        return 3
755
+        mkdir -p "$(dirname "$dest")"   # needed if altname has slashes
755
     }
756
     }
756
     jat__log_info "submitting result: $path$nhint"
757
     jat__log_info "submitting result: $path$nhint"
757
     cp -ar "$path" "$dest"
758
     cp -ar "$path" "$dest"