lib/update.utils
changeset 589 482d06935d96
parent 583 b65ce9123039
child 592 88a7683efc54
equal deleted inserted replaced
588:21b33b9090d0 589:482d06935d96
    14     log_cmd "$@"
    14     log_cmd "$@"
    15 
    15 
    16     "$@" || die "Failed"
    16     "$@" || die "Failed"
    17 }
    17 }
    18 
    18 
       
    19 ### Command execution
       
    20 ## Execute command as a test, logging its execution at log_cmd
       
    21 #
       
    22 #   cmd_test $cmd... && ... || ...
       
    23 #
       
    24 # Fails if the command returns an error exit code.
       
    25 function cmd_test {
       
    26     log_cmd "$@"
       
    27 
       
    28     "$@"
       
    29 }
    19 ## Execute command, prefixing its output on stdout with given indent prefix.
    30 ## Execute command, prefixing its output on stdout with given indent prefix.
    20 #
    31 #
    21 #   indent  "    " $cmd...
    32 #   indent  "    " $cmd...
    22 #
    33 #
    23 # Output is kept on stdout, exit status is that of the given command.
    34 # Output is kept on stdout, exit status is that of the given command.