penguin/utils

my env utils

bash/bashrc/package.sh

raw ยท 535 bytes

#!/bin/bash

function __func_head() {
    echo "Usage:" ${FUNCNAME[1]} $1
}

function __func_help() {
#   echo "Usage:" ${FUNCNAME[1]} $1
    echo "       ${FUNCNAME[1]} $1"
}

# Run through all sources
SDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"/sources

if [ -d "$SDIR" ]; then
    echo "Begin source:"
    for i in $( find $SDIR -maxdepth 1 -type f -perm +111 | sort )
    do
        echo "  Source:" $( basename $i )
        . $i
        if [[ $? -ne 0 ]]; then
            echo "    .. failed"
        fi
    done
fi