| #!/bin/bash |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| function cli_exportFunctions { |
| |
| |
| local LOCATION=$1 |
| |
| |
| local SUFFIX=$2 |
| |
| |
| |
| |
| if [[ $SUFFIX == '' ]];then |
| SUFFIX=$FUNCNAM |
| fi |
| |
| |
| |
| local PATTERN="^function[[:space:]]+${SUFFIX}[[:alnum:]_]*[[:space:]]+{$" |
| |
| |
| local FUNCFILE='' |
| local FUNCFILES=$(cli_getFilesList ${LOCATION} --pattern="${SUFFIX}.*\.sh" --maxdepth="1") |
| |
| |
| |
| |
| |
| if [[ $FUNCFILES == '' ]];then |
| cli_printMessage "`gettext "No function file was found for this action."`" --as-error-line |
| fi |
| |
| |
| for FUNCFILE in $FUNCFILES;do |
| |
| |
| cli_checkFiles $FUNCFILE --execution |
| |
| |
| . $FUNCFILE |
| |
| |
| |
| export -f $(egrep "${PATTERN}" ${FUNCFILE} | gawk '{ print $2 }') |
| |
| done |
| |
| } |