github.com/bhameyie/otto@v0.2.1-0.20160406174117-16052efa52ec/builtin/scriptpack/stdlib/data/main.sh (about)

     1  # Setup all the error cases for scripts. We do this early hoping this is
     2  # the first thing loaded.
     3  
     4  # Load all our functions
     5  . ${SCRIPTPACK_STDLIB_ROOT}/execute.sh
     6  . ${SCRIPTPACK_STDLIB_ROOT}/error.sh
     7  . ${SCRIPTPACK_STDLIB_ROOT}/output.sh
     8  
     9  # Basics
    10  . ${SCRIPTPACK_STDLIB_ROOT}/locale.sh
    11  . ${SCRIPTPACK_STDLIB_ROOT}/vagrant.sh
    12  
    13  # Ubuntu
    14  . ${SCRIPTPACK_STDLIB_ROOT}/apt.sh
    15  
    16  # Function for initializing any scripts. We put this in a function because
    17  # our BATS tests don't call this (it messes them up).
    18  otto_init() {
    19    set -o errexit -o pipefail -o errtrace
    20  }
    21  
    22  # Setup a trap for all errors to be logged
    23  trap 'otto_error "${BASH_SOURCE}" "${LINENO}"' ERR