-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.framework-config
executable file
·61 lines (53 loc) · 3.15 KB
/
.framework-config
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/usr/bin/env bash
# shellcheck disable=SC2034
BASH_TOOLS_ROOT_DIR="$(cd -- "${CURRENT_LOADED_ENV_FILE%/*}" &>/dev/null && pwd -P)"
FRAMEWORK_ROOT_DIR="${BASH_TOOLS_ROOT_DIR}/vendor/bash-tools-framework"
FRAMEWORK_SRC_DIR="${FRAMEWORK_ROOT_DIR}/src"
FRAMEWORK_BIN_DIR="${FRAMEWORK_ROOT_DIR}/bin"
FRAMEWORK_VENDOR_DIR="${FRAMEWORK_ROOT_DIR}/vendor"
FRAMEWORK_VENDOR_BIN_DIR="${FRAMEWORK_VENDOR_DIR}/bin"
# allows to generate bin file in the right directory
export BASH_TOOLS_ROOT_DIR
if [[ ! -v COMPILE_PARAMETERS ]]; then
# compile parameters
# srcFile : file that needs to be compiled
# templateDir : directory from which bash-tpl templates will be searched
# binDir : fallback bin directory in case BIN_FILE has not been provided
# rootDir : directory used to compute src file relative path
# srcDirs : additional directories where to find the functions
COMPILE_PARAMETERS=(
--src-dir "${BASH_TOOLS_ROOT_DIR}/src"
--src-dir "${FRAMEWORK_ROOT_DIR}/src"
--bin-dir "${BASH_TOOLS_ROOT_DIR}/bin"
--root-dir "${BASH_TOOLS_ROOT_DIR}"
--template-dir "${BASH_TOOLS_ROOT_DIR}/src"
)
fi
# describe the functions that will be skipped from being imported
FRAMEWORK_FUNCTIONS_IGNORE_REGEXP="${FRAMEWORK_FUNCTIONS_IGNORE_REGEXP:-^(Namespace::functions|Functions::myFunction|Namespace::requireSomething|IMPORT::dir::file|Acquire::ForceIPv4)$}"
# describe the files that do not contain function to be imported
NON_FRAMEWORK_FILES_REGEXP="${NON_FRAMEWORK_FILES_REGEXP:-(^bin/|\.framework-config|^test\.sh$|^\.github/preCommitGeneration\.sh$|^install$|\.bats$|/testsData/|^manualTests/|/_\.sh$|/ZZZ\.sh$|/__all\.sh$|^src/_binaries|^src/_includes|^src/batsHeaders\.sh$|^conf/)}"
# describe the files that are allowed to not have an associated bats file
BATS_FILE_NOT_NEEDED_REGEXP="${BATS_FILE_NOT_NEEDED_REGEXP:-(^conf/|^bin/|^\.github/preCommitGeneration\.sh$|.framework-config|^install$|\.bats$|/testsData/|^manualTests/|/_\.sh$|/ZZZ\.sh$|/__all\.sh$|^src/batsHeaders\.sh$|^src/_includes|^src/_binaries/.*-(options|main)\.sh$|^conf/|^src/_binaries/commandDefinitions/options.*\.sh$|/testsData/|^test\.sh$)}"
# describe the files that are allowed to not have a function matching the filename
FRAMEWORK_FILES_FUNCTION_MATCHING_IGNORE_REGEXP="${FRAMEWORK_FILES_FUNCTION_MATCHING_IGNORE_REGEXP:-^conf/|^bin/|^\.framework-config$|\.tpl$|testsData/binaryFile$}"
# Source directories
if [[ ! -v FRAMEWORK_SRC_DIRS ]]; then
FRAMEWORK_SRC_DIRS=(
"${BASH_TOOLS_ROOT_DIR}/src"
"${FRAMEWORK_SRC_DIR}"
)
fi
# export here all the variables that will be used in your templates
export REPOSITORY_URL="${REPOSITORY_URL:-https://github.com/fchastanet/bash-tools}"
SRC_FILE_PATH="${CURRENT_COMPILED_RELATIVE_FILE#/}"
BASH_FRAMEWORK_THEME="${BASH_FRAMEWORK_THEME:-default}"
BASH_FRAMEWORK_LOG_LEVEL="${BASH_FRAMEWORK_LOG_LEVEL:-0}"
BASH_FRAMEWORK_DISPLAY_LEVEL="${BASH_FRAMEWORK_DISPLAY_LEVEL:-3}"
BASH_FRAMEWORK_LOG_FILE="${BASH_FRAMEWORK_LOG_FILE:-${BASH_TOOLS_ROOT_DIR}/logs/${0##*/}.log}"
BASH_FRAMEWORK_LOG_FILE_MAX_ROTATION="${BASH_FRAMEWORK_LOG_FILE_MAX_ROTATION:-5}"
# display elapsed time since last log
DISPLAY_DURATION=${DISPLAY_DURATION:-1}
BINARIES_DIR=(
src/_binaries
)