Skip to content

Commit

Permalink
migrated to bash-tools-framework 2.0.0 - use CURRENT_LOADED_ENV_FILE…
Browse files Browse the repository at this point in the history
… to deduce realiably root dir using .framework-config
  • Loading branch information
fchastanet committed Dec 2, 2023
1 parent f4cb5ae commit 42a4c2f
Show file tree
Hide file tree
Showing 19 changed files with 27 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .framework-config
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
# shellcheck disable=SC2034

BASH_TOOLS_ROOT_DIR="${BASH_TOOLS_ROOT_DIR:-$(cd "$(readlink -e "${BASH_SOURCE[0]%/*}")" && pwd -P)}"
BASH_TOOLS_ROOT_DIR="$(cd -- "$(dirname -- "${CURRENT_LOADED_ENV_FILE}")" &>/dev/null && pwd -P)"
FRAMEWORK_ROOT_DIR="${FRAMEWORK_ROOT_DIR:-${BASH_TOOLS_ROOT_DIR}/vendor/bash-tools-framework}"
FRAMEWORK_SRC_DIR="${FRAMEWORK_SRC_DIR:-${FRAMEWORK_ROOT_DIR}/src}"
FRAMEWORK_BIN_DIR="${FRAMEWORK_BIN_DIR:-${FRAMEWORK_ROOT_DIR}/bin}"
Expand Down
6 changes: 5 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ repos:
- id: prettier

- repo: https://github.com/fchastanet/bash-tools-framework
rev: 1.1.8
rev: 2.0.0
hooks:
- id: fixShebangExecutionBit
- id: fixShebangExecutionBitGithubActions
Expand All @@ -77,6 +77,8 @@ repos:
plain,
--theme,
default-force,
--display-level,
WARNING,
]
- id: frameworkLinterGithubAction
args:
Expand All @@ -87,6 +89,8 @@ repos:
checkstyle,
--theme,
default-force,
--display-level,
WARNING,
]
- id: plantuml
- id: buildShFiles
Expand Down
2 changes: 1 addition & 1 deletion bin/cli
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ Env::requireLoad() {

for file in "${configFiles[@]}"; do
# shellcheck source=/.framework-config
source "${file}" || {
CURRENT_LOADED_ENV_FILE="${file}" source "${file}" || {
Log::displayError "while loading config file: ${file}"
return 1
}
Expand Down
2 changes: 1 addition & 1 deletion bin/dbImport
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ Env::requireLoad() {

for file in "${configFiles[@]}"; do
# shellcheck source=/.framework-config
source "${file}" || {
CURRENT_LOADED_ENV_FILE="${file}" source "${file}" || {
Log::displayError "while loading config file: ${file}"
return 1
}
Expand Down
2 changes: 1 addition & 1 deletion bin/dbImportProfile
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ Env::requireLoad() {

for file in "${configFiles[@]}"; do
# shellcheck source=/.framework-config
source "${file}" || {
CURRENT_LOADED_ENV_FILE="${file}" source "${file}" || {
Log::displayError "while loading config file: ${file}"
return 1
}
Expand Down
2 changes: 1 addition & 1 deletion bin/dbImportStream
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ Env::requireLoad() {

for file in "${configFiles[@]}"; do
# shellcheck source=/.framework-config
source "${file}" || {
CURRENT_LOADED_ENV_FILE="${file}" source "${file}" || {
Log::displayError "while loading config file: ${file}"
return 1
}
Expand Down
6 changes: 3 additions & 3 deletions bin/dbQueryAllDatabases

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions bin/dbScriptAllDatabases

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bin/doc
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ Env::requireLoad() {

for file in "${configFiles[@]}"; do
# shellcheck source=/.framework-config
source "${file}" || {
CURRENT_LOADED_ENV_FILE="${file}" source "${file}" || {
Log::displayError "while loading config file: ${file}"
return 1
}
Expand Down
2 changes: 1 addition & 1 deletion bin/gitIsAncestorOf
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ Env::requireLoad() {

for file in "${configFiles[@]}"; do
# shellcheck source=/.framework-config
source "${file}" || {
CURRENT_LOADED_ENV_FILE="${file}" source "${file}" || {
Log::displayError "while loading config file: ${file}"
return 1
}
Expand Down
2 changes: 1 addition & 1 deletion bin/gitIsBranch
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ Env::requireLoad() {

for file in "${configFiles[@]}"; do
# shellcheck source=/.framework-config
source "${file}" || {
CURRENT_LOADED_ENV_FILE="${file}" source "${file}" || {
Log::displayError "while loading config file: ${file}"
return 1
}
Expand Down
2 changes: 1 addition & 1 deletion bin/gitRenameBranch
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ Env::requireLoad() {

for file in "${configFiles[@]}"; do
# shellcheck source=/.framework-config
source "${file}" || {
CURRENT_LOADED_ENV_FILE="${file}" source "${file}" || {
Log::displayError "while loading config file: ${file}"
return 1
}
Expand Down
2 changes: 1 addition & 1 deletion bin/installRequirements
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ Env::requireLoad() {

for file in "${configFiles[@]}"; do
# shellcheck source=/.framework-config
source "${file}" || {
CURRENT_LOADED_ENV_FILE="${file}" source "${file}" || {
Log::displayError "while loading config file: ${file}"
return 1
}
Expand Down
2 changes: 1 addition & 1 deletion bin/mysql2puml
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ Env::requireLoad() {

for file in "${configFiles[@]}"; do
# shellcheck source=/.framework-config
source "${file}" || {
CURRENT_LOADED_ENV_FILE="${file}" source "${file}" || {
Log::displayError "while loading config file: ${file}"
return 1
}
Expand Down
2 changes: 1 addition & 1 deletion bin/upgradeGithubRelease
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ Env::requireLoad() {

for file in "${configFiles[@]}"; do
# shellcheck source=/.framework-config
source "${file}" || {
CURRENT_LOADED_ENV_FILE="${file}" source "${file}" || {
Log::displayError "while loading config file: ${file}"
return 1
}
Expand Down
2 changes: 1 addition & 1 deletion bin/waitForIt
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ Env::requireLoad() {

for file in "${configFiles[@]}"; do
# shellcheck source=/.framework-config
source "${file}" || {
CURRENT_LOADED_ENV_FILE="${file}" source "${file}" || {
Log::displayError "while loading config file: ${file}"
return 1
}
Expand Down
2 changes: 1 addition & 1 deletion bin/waitForMysql
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ Env::requireLoad() {

for file in "${configFiles[@]}"; do
# shellcheck source=/.framework-config
source "${file}" || {
CURRENT_LOADED_ENV_FILE="${file}" source "${file}" || {
Log::displayError "while loading config file: ${file}"
return 1
}
Expand Down
2 changes: 1 addition & 1 deletion conf/dbScripts/extractData
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ Env::requireLoad() {

for file in "${configFiles[@]}"; do
# shellcheck source=/.framework-config
source "${file}" || {
CURRENT_LOADED_ENV_FILE="${file}" source "${file}" || {
Log::displayError "while loading config file: ${file}"
return 1
}
Expand Down
2 changes: 1 addition & 1 deletion install
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ Env::requireLoad() {

for file in "${configFiles[@]}"; do
# shellcheck source=/.framework-config
source "${file}" || {
CURRENT_LOADED_ENV_FILE="${file}" source "${file}" || {
Log::displayError "while loading config file: ${file}"
return 1
}
Expand Down

0 comments on commit 42a4c2f

Please sign in to comment.