Browse Source

Die in case popd fails

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

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

708
     # End active phase
708
     # End active phase
709
     #
709
     #
710
     local oldpdir
710
     local oldpdir
711
+    local oldpwd
711
     oldpdir=$(__jat__sd_keyR P.pdir)
712
     oldpdir=$(__jat__sd_keyR P.pdir)
713
+    oldpwd=$(__jat__sd_keyR P.PWD)
712
     test -n "$oldpdir" && {
714
     test -n "$oldpdir" && {
713
         jat__log_info "changing back from phase dir: $oldpdir"
715
         jat__log_info "changing back from phase dir: $oldpdir"
714
-        popd >/dev/null
716
+        popd >/dev/null \
717
+         || jat__die "failed to go back from phase dir: $oldpdir to $oldpwd"
715
     }
718
     }
716
     __jat__show_pend
719
     __jat__show_pend
717
     __jat__pdummy
720
     __jat__pdummy