utils/bash/bashrc/package.sh

37 lines
756 B
Bash
Raw Normal View History

2014-08-04 09:40:25 +00:00
#!/bin/bash
2015-05-14 01:58:15 +00:00
case $( uname -a | awk '{ print $1 }' ) in
Darwin) # although this is deprecated, Mac still use it
PERM="+111"
;;
Linux) ;&
CYGWIN~) ;&
*)
PERM="/111"
;;
esac
2014-08-04 09:40:25 +00:00
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
2015-03-23 07:59:03 +00:00
if [ -d "$SDIR" ]; then
echo "Begin source:"
2015-05-14 01:58:15 +00:00
for i in $( find $SDIR -maxdepth 1 -type f -perm $PERM | sort )
2015-03-23 07:59:03 +00:00
do
echo " Source:" $( basename $i )
. $i
if [[ $? -ne 0 ]]; then
echo " .. failed"
fi
done
fi