Skip to content

Commit 6c69897

Browse files
authored
clean .frameworkConfig and refactored Env::requireLoad (#120)
- display default log/display level value - removed src/_includes/.framework-config.default - removed Env::getOrderedConfFiles - removed Env::mergeConfFiles - removed Framework::loadConfig
1 parent cceaa34 commit 6c69897

35 files changed

+1978
-1104
lines changed

.framework-config

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,11 @@
11
#!/usr/bin/env bash
2-
# shellcheck disable=SC2034
32

43
FRAMEWORK_ROOT_DIR="$(cd -- "${CURRENT_LOADED_ENV_FILE%/*}" &>/dev/null && pwd -P)"
54
FRAMEWORK_SRC_DIR="${FRAMEWORK_SRC_DIR:-${FRAMEWORK_ROOT_DIR}/src}"
65
FRAMEWORK_BIN_DIR="${FRAMEWORK_BIN_DIR:-${FRAMEWORK_ROOT_DIR}/bin}"
76
FRAMEWORK_VENDOR_DIR="${FRAMEWORK_VENDOR_DIR:-${FRAMEWORK_ROOT_DIR}/vendor}"
87
FRAMEWORK_VENDOR_BIN_DIR="${FRAMEWORK_VENDOR_BIN_DIR:-${FRAMEWORK_ROOT_DIR}/vendor/bin}"
98

10-
if [[ ! -v COMPILE_PARAMETERS ]]; then
11-
# compile parameters
12-
# srcFile : file that needs to be compiled
13-
# templateDir : directory from which templates will be searched
14-
# binDir : fallback bin directory in case BIN_FILE has not been provided
15-
# rootDir : directory used to compute src file relative path
16-
# srcDirs : additional directories where to find the functions
17-
COMPILE_PARAMETERS=(
18-
--src-dir "${FRAMEWORK_SRC_DIR}"
19-
--bin-dir "${FRAMEWORK_BIN_DIR}"
20-
--root-dir "${FRAMEWORK_ROOT_DIR}"
21-
--template-dir "${FRAMEWORK_SRC_DIR}"
22-
)
23-
fi
24-
259
# describe the functions that will be skipped from being imported
2610
FRAMEWORK_FUNCTIONS_IGNORE_REGEXP="${FRAMEWORK_FUNCTIONS_IGNORE_REGEXP:-^(Namespace::functions|Functions::myFunction|Namespace::requireSomething|IMPORT::dir::file|Acquire::ForceIPv4)$}"
2711
# describe the files that do not contain function to be imported
@@ -36,15 +20,3 @@ if [[ ! -v FRAMEWORK_SRC_DIRS ]]; then
3620
"${FRAMEWORK_ROOT_DIR}/src"
3721
)
3822
fi
39-
40-
# export here all the variables that will be used in your templates
41-
export REPOSITORY_URL="${REPOSITORY_URL:-https://github.com/fchastanet/bash-tools-framework}"
42-
43-
BASH_FRAMEWORK_THEME="${BASH_FRAMEWORK_THEME:-default}"
44-
BASH_FRAMEWORK_LOG_LEVEL="${BASH_FRAMEWORK_LOG_LEVEL:-0}"
45-
BASH_FRAMEWORK_DISPLAY_LEVEL="${BASH_FRAMEWORK_DISPLAY_LEVEL:-3}"
46-
BASH_FRAMEWORK_LOG_FILE="${BASH_FRAMEWORK_LOG_FILE:-${FRAMEWORK_ROOT_DIR}/logs/${0##*/}.log}"
47-
BASH_FRAMEWORK_LOG_FILE_MAX_ROTATION="${BASH_FRAMEWORK_LOG_FILE_MAX_ROTATION:-5}"
48-
49-
# display elapsed time since last log
50-
DISPLAY_DURATION=${DISPLAY_DURATION:-1}

.pre-commit-config-github.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ repos:
160160
args:
161161
[
162162
--expected-warnings-count,
163-
"78",
163+
"73",
164164
--format,
165165
plain,
166166
--theme,
@@ -172,7 +172,7 @@ repos:
172172
args:
173173
[
174174
--expected-warnings-count,
175-
"78",
175+
"73",
176176
--format,
177177
checkstyle,
178178
--theme,
@@ -195,6 +195,6 @@ repos:
195195
stages: [manual] # GITHUB
196196

197197
- repo: https://github.com/fchastanet/bash-compiler
198-
rev: 3.1.2
198+
rev: 3.1.3
199199
hooks:
200200
- id: buildBashBinaries

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ repos:
155155
args:
156156
[
157157
--expected-warnings-count,
158-
"78",
158+
"73",
159159
--format,
160160
plain,
161161
--theme,
@@ -167,7 +167,7 @@ repos:
167167
args:
168168
[
169169
--expected-warnings-count,
170-
"78",
170+
"73",
171171
--format,
172172
checkstyle,
173173
--theme,
@@ -190,6 +190,6 @@ repos:
190190
stages: [] # GITHUB
191191

192192
- repo: https://github.com/fchastanet/bash-compiler
193-
rev: 3.1.2
193+
rev: 3.1.3
194194
hooks:
195195
- id: buildBashBinaries

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,6 @@ Here an excerpt of the namespaces available in Bash tools framework:
160160
- Filters : various functions to filter files using grep, awk or sed eg:
161161
Filters::bashFrameworkFunctions allows to find all the bash framework
162162
functions used in a file
163-
- Framework : Framework::loadConfig loads `.framework-config` configuration
164-
file.
165163
- Git : provides git abstractions like Git::cloneOrPullIfNoChange,
166164
Git::pullIfNoChanges or Git::shallowClone
167165
- Install : copy directory or file, backup them before if needed.

0 commit comments

Comments
 (0)