extract "include_files" function

This commit is contained in:
Jérémy Lecour 2023-07-03 11:41:18 +02:00 committed by Jérémy Lecour
parent 8271602a30
commit 71e49db330
Signed by: jlecour
SSH key fingerprint: SHA256:h+5LgHRKwN9lS0SsdVR5yZPeFlJE4Mt+8UtL4CcP8dY
2 changed files with 10 additions and 2 deletions

View file

@ -7,6 +7,8 @@ and this project **does not adhere to [Semantic Versioning](http://semver.org/sp
### Changed
* extract "include_files" function
### Deprecated
### Removed

View file

@ -254,10 +254,16 @@ source_configuration() {
source_file_or_error "${config_file}"
fi
}
include_files() {
if [ -d "${includes_dir}" ]; then
find ${includes_dir} -type f -readable -not -name '*.*' | sort -h
else
echo ""
fi
}
source_includes() {
if [ -d "${includes_dir}" ]; then
include_files=$(find ${includes_dir} -type f -readable -not -name '*.*' | sort -h)
for include_file in ${include_files}; do
for include_file in $(include_files); do
source_file_or_error "${include_file}"
done
fi