Skip to content

Commit 64d359a

Browse files
authored
Merge pull request #244 from tegonal/feature/only-one-runShellcheck-script
move runShellcheckPullHooks to run-shellcheck
2 parents ffe5769 + d5657c9 commit 64d359a

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

src/qa/run-shellcheck-pull-hooks.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ if ! [[ -v dir_of_tegonal_scripts ]]; then
3737
fi
3838
sourceOnce "$dir_of_tegonal_scripts/qa/run-shellcheck.sh"
3939

40-
#TODO move to run-shellcheck with 5.0.0
40+
#TODO remove file, runShellcheckPullHooks is no also in run-shellcheck.sh
4141
function runShellcheckPullHooks() {
4242
if ! (($# == 1)); then
4343
logError "Exactly one parameter needs to be passed to runShellcheckPullHooks, given \033[0;36m%s\033[0m\nFollowing a description of the parameters:" "$#"

src/qa/run-shellcheck.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,21 @@ function runShellcheck() {
112112
logSuccess "no shellcheck issues found, analysed %s files (%s symlinks skipped) in paths:\n%s" "$fileCounter" "$skipped" "$runShellcheck_paths_as_string"
113113
fi
114114
}
115+
116+
function runShellcheckPullHooks() {
117+
if ! (($# == 1)); then
118+
logError "Exactly one parameter needs to be passed to runShellcheckPullHooks, given \033[0;36m%s\033[0m\nFollowing a description of the parameters:" "$#"
119+
echo >&2 '1: gt_dir working directory of gt'
120+
printStackTrace
121+
exit 9
122+
fi
123+
local -r gt_dir=$1
124+
125+
local -r gt_remote_dir="$gt_dir/remotes/"
126+
logInfo "analysing $gt_remote_dir/**/pull-hook.sh"
127+
128+
# shellcheck disable=SC2034 # is passed by name to runShellcheck
129+
local -ra dirs2=("$gt_remote_dir")
130+
local sourcePath="$dir_of_tegonal_scripts"
131+
runShellcheck dirs2 "$sourcePath" -name "pull-hook.sh"
132+
}

0 commit comments

Comments
 (0)