Skip to content

Commit

Permalink
update files of remote tegonal-scripts to version v3.5.0 via gt
Browse files Browse the repository at this point in the history
  • Loading branch information
robstoll authored and github-actions[bot] committed Oct 21, 2024
1 parent aef6be9 commit 4ecbd12
Show file tree
Hide file tree
Showing 20 changed files with 124 additions and 93 deletions.
38 changes: 19 additions & 19 deletions .gt/remotes/tegonal-scripts/pulled.tsv
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
#@ Version: 1.0.0
tag file relativeTarget sha512
v3.2.0 src/setup.sh ../lib/tegonal-scripts/src/setup.sh f6221b322efb57a8e595c4d033e18ee3d4ba7b373f549fc1e608401a2976ac03e09f4f033787f3d25896d7cf9447edf074f558259c7813df65792440bc472e09
v3.2.0 src/utility/io.sh ../lib/tegonal-scripts/src/utility/io.sh 701867a847119f4da16af5cc75c1261bf53d2a7e0d61c289e5b1358e28aba34d2ab0e964adb3bc18d0c249ed869c29440463a5b8aa70376a47d42293813e1549
v3.2.0 src/utility/array-utils.sh ../lib/tegonal-scripts/src/utility/array-utils.sh 34e6549d3208d4bee23e28a9c81b7f6774280a5a9afd5759fc5ace8161d35a87acfec707b75d447a427e6f4f3ad14d6ba48529a92f7a0be91526e456bc2d85a1
v3.2.0 src/utility/parse-utils.sh ../lib/tegonal-scripts/src/utility/parse-utils.sh 31c842882e85e4ed9192b31f042a8348229776622d01d6c15f49caee4faf49da74c7d50f379c532fc4998da52cedd51a36e92b432f71908cd31ce84652653918
v3.2.0 src/utility/git-utils.sh ../lib/tegonal-scripts/src/utility/git-utils.sh 5766b484335d71b7889e0060905295eb3b43acc1ea102d23d859eb83537940f0165c5a29d818d8ba8017e9a46824a2b11328e13bdc8160d31699ebfa0b4e809a
v3.2.0 src/utility/gpg-utils.sh ../lib/tegonal-scripts/src/utility/gpg-utils.sh 57dc45a171642bd8925f73eb44c2fbccbf9084e0c95a868d1204b2d7b5d330f9b549db2af5ba9907dae7f0852ece39ab1656274ac383cebd0abbb0d12cee1eff
v3.2.0 src/utility/log.sh ../lib/tegonal-scripts/src/utility/log.sh 3ff775eb686499bf75f497c7071fbe0c64c0b2a129318a7f0010870b9b4328848aa029d98a2d1cc58dab5b15834e5e689a2efbec981e9898eb5af68c729e49df
v3.2.0 src/utility/parse-fn-args.sh ../lib/tegonal-scripts/src/utility/parse-fn-args.sh 9d93c8fb0bea1109a4cf51438eda04c70b2479e51ff05eef529e2715405c054339620117d3164876e6f325612be641da6653fce9435a637b3768b01a89c5c9d6
v3.2.0 src/utility/update-bash-docu.sh ../lib/tegonal-scripts/src/utility/update-bash-docu.sh 8f564cf2946d4ab4a8089331990ddfc24f7194dbe1d4377505faced56d6a4e60bab0c3dfbaf39662676f49d36bfa9f79594d9177ba2c9ec46f825d332529516b
v3.2.0 src/utility/parse-args.sh ../lib/tegonal-scripts/src/utility/parse-args.sh 7fa58fc83d65ed11393f2ee688aedc5d133571194dc6c3bb7b053133154f53d8909cf9f732d619d70d17d6cc37d2f392ae1b0d6d055602893b74cbcde06425e2
v3.2.0 src/utility/checks.sh ../lib/tegonal-scripts/src/utility/checks.sh 5d2482992c3c0e562faba718b3946cdb8b58cdf5fc5d6ece6a5a4a0050262ec80ea2f95b6f6b927940298171747adcda511325991c6a530d8af8c4a5a454faa7
v3.2.0 src/utility/parse-commands.sh ../lib/tegonal-scripts/src/utility/parse-commands.sh 6ac7234f74f545942cab445ea90c157203075839abfd20191bfec266d6c15fbfac681523543fb61ccf5f1dbc16cc3125c5a86ec9daf1d763ef2af634acde506e
v3.2.0 src/utility/replace-snippet.sh ../lib/tegonal-scripts/src/utility/replace-snippet.sh 861813fee3650a32ad89548f4a816eeaa85b713dd146791d4afe342af30cc1bded27f620fae8702886c6fd58a00c9cc8da9b3254cefcf3155d748a021272c32e
v3.2.0 src/utility/ask.sh ../lib/tegonal-scripts/src/utility/ask.sh e7dc9cf595aa46cb1593db997e6079546371e5b9e832a5233301a2d3d73378a579de47ed1742e42aa845a932ab5e6758208f2d2c505263ee8eecc2c164f72d6b
v3.2.0 src/utility/replace-help-snippet.sh ../lib/tegonal-scripts/src/utility/replace-help-snippet.sh f0b90b8ed4bdea02609ca71df547d5853e315fc30b7e2ea8aaeb20ffcb5da910045d8cdde213137350e8f26d529032f626b558d81cc436c31b22467ef1cb3dfd
v3.2.0 src/utility/source-once.sh ../lib/tegonal-scripts/src/utility/source-once.sh 6b6688d85a5a0c591c73d2ef32a0b896266ceb6af7cea0f06afd8a645b46b2e38abf1eaa2efa444a06382ef0c170de6a2ba2e14062fba0bfa0d384198e0ac1a2
v3.2.0 src/utility/recursive-declare-p.sh ../lib/tegonal-scripts/src/utility/recursive-declare-p.sh 10a0d54232712ca7dd56297d7022194f6fcadf564c458d3ff04a15d8539989d8d727db9e903e0a062e0cd75667b71cf8f56444d9116f37664505ac19610ce2fb
v3.2.0 src/ci/install-shellcheck.sh ../lib/tegonal-scripts/src/ci/install-shellcheck.sh 628dafc9ab0a44bd588785631f3d1f58f79f8764d3d628796fdb913d50cbf5991baa2d5df3d3b62d0d93ae41eef6d36f547a32186438f42c1430758e089f711e
v3.2.0 src/qa/run-shellcheck.sh ../lib/tegonal-scripts/src/qa/run-shellcheck.sh e717ded82bd1545d355a101486a8e746786a224c6110ba0b8451b9754822901f2636320092cf813a55a082c45ae96943cf963c6261c361f2c753f646bb36aa98
v3.5.0 src/setup.sh ../lib/tegonal-scripts/src/setup.sh c72440ceb9dfffca3feacb4d652f8b6ad1266277a1549b6271a47e1c0fdc0746994cf01a1a0335a95e1c7e93454a1fdade9007d7d2226f20e95e6f52ea0d0fa7
v3.5.0 src/utility/io.sh ../lib/tegonal-scripts/src/utility/io.sh e905f8ec3c0ea6b5d3a3c3a295bab690cc2b9d42ec784d56ec525f24044490c216756e05f6d9312f6379821e3f7208d44990bd8c598e9b268f40cc933951dcc9
v3.5.0 src/utility/array-utils.sh ../lib/tegonal-scripts/src/utility/array-utils.sh 357c47ad757cdd8be932f2c1b6c000c58e5b502fe1d19c921568d736355e04ff01b652b407a0f04664ccfc1c2cfbd8e0b3b8a695521ce0a3a88eb289c8cbaf38
v3.5.0 src/utility/parse-utils.sh ../lib/tegonal-scripts/src/utility/parse-utils.sh 04164299e848f75681497284e5c9b358a62f98d213c60d9f2a576342f7a116a9b1a4acf6a591d1535dfc0351b2f656a3f8c4f838ec8e01611f94c3e0111e46d2
v3.5.0 src/utility/git-utils.sh ../lib/tegonal-scripts/src/utility/git-utils.sh dcbf51d144a2e797df34862e495fcb1a8c0387990c7454158c40f5ebf38d1837a9c75fca09c5fa4ae88905b2d21ceafa3ee657bb6ab2cbc3924dea51e47393b3
v3.5.0 src/utility/gpg-utils.sh ../lib/tegonal-scripts/src/utility/gpg-utils.sh ea15975b230cabcc1d75afea011270b4d5c03e2ea4dda8558bd2060b4a2b4f02d48022019c83b23d85f83fefc7de1a8a87318cda0af7e948c3912aa3d7cda8b7
v3.5.0 src/utility/log.sh ../lib/tegonal-scripts/src/utility/log.sh 3fdea7b78d37c9424602c1d0ff90ff19b7e7d3674d8ad412777754221118851ebdab41c129fb9181110a3639a19712ebf81ed35d4b86314814a53d99bbb2b26f
v3.5.0 src/utility/parse-fn-args.sh ../lib/tegonal-scripts/src/utility/parse-fn-args.sh 64b8f1dac3ed9cf860719b40f6e9adfa973096a4754714de20bbb9f42ade1572a754eeea1495a12395529bd71f1d4b280e613a23d26edd7e5546486fe9b9cbb4
v3.5.0 src/utility/update-bash-docu.sh ../lib/tegonal-scripts/src/utility/update-bash-docu.sh a2194e8afba6d70589d3f3aed954e303c956125746ddbdd97beaa0ef015d354ce08949c712cbb80e26a0da52399cb90d8551b9dc60ab2ac890c6d1e8b03318da
v3.5.0 src/utility/parse-args.sh ../lib/tegonal-scripts/src/utility/parse-args.sh 18a1b91f8e3aa6c61805ca8a9cf43ac87a817b61032297455aaff198a65b9d2fbfcb7bb3bdac9a940020129694ce2a7997d917e51413e8228dce4265df59a96a
v3.5.0 src/utility/checks.sh ../lib/tegonal-scripts/src/utility/checks.sh 1a25b07c8a19b93b5ca91582fb636e9273911fed455de2964a803ac09416201739bcd66eab39a94d9916f8d4a668c5c75bbd8f4b5bf6fb4fdc11b912d056b245
v3.5.0 src/utility/parse-commands.sh ../lib/tegonal-scripts/src/utility/parse-commands.sh 9e2b1a685aa14c574e1421ba6e3155a112dc47c069a09d048ced9f22eb85b400c701239ae5c64f898c384df97d849a008925ca22b67cfba42e89a8c5fc09a16a
v3.5.0 src/utility/replace-snippet.sh ../lib/tegonal-scripts/src/utility/replace-snippet.sh 0eaf94a12decc88f3c905290da1b18d0037f6d9fb6908517d3d85ec48972e0ee0288e8de5e2b88fb36e4d24f5ebe8d9a5b819d0afe5c7f35ad778c41b1a3f1d5
v3.5.0 src/utility/ask.sh ../lib/tegonal-scripts/src/utility/ask.sh 4678ad9224783ef52e49e6eb65c16eea902a1a22d28754fd70911b5bceb1810093e6942a57ed473c99a4ae8985b649b569444e16a549a80f102eff97a43d4691
v3.5.0 src/utility/replace-help-snippet.sh ../lib/tegonal-scripts/src/utility/replace-help-snippet.sh 6fb6bd4aacc13cd02889b125642ceb0b7e3cf7032412d692f85fa412f9457873345aa49d53d98fefdd8056f84bc36d0dea4e8f1e6ee4d7adff3de67c23bccc40
v3.5.0 src/utility/source-once.sh ../lib/tegonal-scripts/src/utility/source-once.sh f9464a208738c42754b316328586eb7a5c52cffddb57aa27ce15c4e67889667d4b7df6736a97df5ce0ca64ffe430151c6055f6e0cb53c0057f7111242895394c
v3.5.0 src/utility/recursive-declare-p.sh ../lib/tegonal-scripts/src/utility/recursive-declare-p.sh b48bd331c9d3300ab676e969fd8b51bffb409de15b5745f30a7f3867a1a14a50828c5f83e4bc104c5e481261508578903a579986b7e2b7b0f23fe0d5e1ead621
v3.5.0 src/ci/install-shellcheck.sh ../lib/tegonal-scripts/src/ci/install-shellcheck.sh 5dd7f1e67ebe2c1c1ea2e51b6e42ace0cf9c2963781b873d223e279c0df03c64b2781bb67c2d8ad1630915f24145fda3a4ab965250be91f20f9cd0574654563e
v3.5.0 src/qa/run-shellcheck.sh ../lib/tegonal-scripts/src/qa/run-shellcheck.sh c4777d0e64ccfdfd96114227ca703668a9938d3c27cd7f931ef10b8eb7cd943c089dc1b83c4508c77fea275e656b0d9e548157b64f68fa55446a344443ef7cce
4 changes: 2 additions & 2 deletions lib/tegonal-scripts/src/ci/install-shellcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# \__/\__/\_, /\___/_//_/\_,_/_/ It is licensed under Apache License 2.0
# /___/ Please report bugs and contribute back your improvements
#
# Version: v3.2.0
# Version: v3.5.0
####### Description #############
#
# function which searches for *.sh files within defined paths (directories or a single *.sh) and
Expand All @@ -20,7 +20,7 @@
#
# jobs:
# steps:
# - name: install shellcheck v0.10.0
# - name: install shellcheck
# run: ./lib/tegonal-scripts/src/ci/install-shellcheck.sh
# # and most likely as well
# - name: run shellcheck
Expand Down
4 changes: 2 additions & 2 deletions lib/tegonal-scripts/src/qa/run-shellcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# \__/\__/\_, /\___/_//_/\_,_/_/ It is licensed under Apache License 2.0
# /___/ Please report bugs and contribute back your improvements
#
# Version: v3.2.0
# Version: v3.5.0
####### Description #############
#
# function which searches for *.sh files within defined paths (directories or a single *.sh) and
Expand Down Expand Up @@ -58,7 +58,7 @@ function runShellcheck() {
fi
local -rn runShellcheck_paths=$1
local -r sourcePath=$2
shift 2 || die "could not shift by 2"
shift 2 || traceAndDie "could not shift by 2"

exitIfArgIsNotArrayOrIsEmpty runShellcheck_paths 1

Expand Down
2 changes: 1 addition & 1 deletion lib/tegonal-scripts/src/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# \__/\__/\_, /\___/_//_/\_,_/_/ It is licensed under Apache License 2.0
# /___/ Please report bugs and contribute back your improvements
#
# Version: v3.2.0
# Version: v3.5.0
####### Description #############
#
# script which should be sourced and sets up variables and functions for the scripts
Expand Down
12 changes: 6 additions & 6 deletions lib/tegonal-scripts/src/utility/array-utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# \__/\__/\_, /\___/_//_/\_,_/_/ It is licensed under Apache License 2.0
# /___/ Please report bugs and contribute back your improvements
#
# Version: v3.2.0
# Version: v3.5.0
####### Description #############
#
# utility functions for dealing with arrays
Expand Down Expand Up @@ -63,7 +63,7 @@ sourceOnce "$dir_of_tegonal_scripts/utility/checks.sh"

joinByChar() {
local IFS="$1"
shift || die "could not shift by 1"
shift 1 || traceAndDie "could not shift by 1"
echo "$*"
}

Expand All @@ -78,7 +78,7 @@ joinByString() {
if (($# > 1)); then
local separator="$1"
local firstArg="$2"
shift 2 || die "could not shift by 2"
shift 2 || traceAndDie "could not shift by 2"
printf "%s" "$firstArg" "${@/#/$separator}"
fi
}
Expand All @@ -96,7 +96,7 @@ function arrFilter() {
local -rn arrFilter_arrIn=$1
local -rn arrFilter_arrOut=$2
local -r predicate=$3
shift 3 || die "could not shift by 3"
shift 3 || traceAndDie "could not shift by 3"

exitIfArgIsNotFunction "$predicate" 3

Expand Down Expand Up @@ -127,7 +127,7 @@ function arrTakeEveryX() {
local -rn arrFilterMod_arrOut=$2
local -ri modulo=$3
local -ri offset=$4
shift 4 || die "could not shift by 4"
shift 4 || traceAndDie "could not shift by 4"

# shellcheck disable=SC2317 # is passed by name to arrFilter
function arrFilterMod_fn() {
Expand All @@ -146,7 +146,7 @@ function arrStringEntryMaxLength() {
exit 9
fi
local -rn arrStringEntryMaxLength_arr=$1
shift || die "could not shift by 1"
shift 1 || traceAndDie "could not shift by 1"

local -i i maxLength=0 arrLength="${#arrStringEntryMaxLength_arr[@]}"
for ((i = 0; i < arrLength; ++i)); do
Expand Down
10 changes: 5 additions & 5 deletions lib/tegonal-scripts/src/utility/ask.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# \__/\__/\_, /\___/_//_/\_,_/_/ It is licensed under Apache License 2.0
# /___/ Please report bugs and contribute back your improvements
#
# Version: v3.2.0
# Version: v3.5.0
####### Description #############
#
# Utility functions to ask the user something via input.
Expand Down Expand Up @@ -55,7 +55,7 @@ function askYesOrNo() {
exit 9
fi
local -r question=$1
shift || die "could not shift by 1"
shift 1 || traceAndDie "could not shift by 1"

local -r askYesOrNo_timeout=20
local answer='n'
Expand All @@ -68,9 +68,9 @@ function askYesOrNo() {

# shellcheck disable=SC2059 # the question itself can have %s thus we use it in the format string
askWithTimeout "\033[0;36m$question\033[0m y/[n]:" "$askYesOrNo_timeout" askYesOrNo_noAnswerCallback answer "" "$@"
if [[ $answer == y ]] || [[ $answer == Y ]]; then
if [[ $answer == y ]] || [[ $answer == Y ]] || [[ $answer == yes ]]; then
return 0
elif [[ $answer == n ]] || [[ $answer == N ]]; then
elif [[ $answer == n ]] || [[ $answer == N ]] || [[ $answer == no ]]; then
return 1
else
logWarning "got \033[0;36m%s\033[0m as answer (instead of y for yes or n for no), interpreting it as a n, i.e. as a no" "$answer"
Expand Down Expand Up @@ -99,7 +99,7 @@ function askWithTimeout() {
local -r askWithTimeout_noAnswerFn=$3
local -r askWithTimeout_outVarName=$4
local -r askWithTimeout_readArgs=$5
shift 5 || die "could not shift by 5"
shift 5 || traceAndDie "could not shift by 5"

exitIfArgIsNotFunction "$askWithTimeout_noAnswerFn" 3
# shellcheck disable=SC2059 # the question itself can have %s thus we use it in the format string
Expand Down
33 changes: 24 additions & 9 deletions lib/tegonal-scripts/src/utility/checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# \__/\__/\_, /\___/_//_/\_,_/_/ It is licensed under Apache License 2.0
# /___/ Please report bugs and contribute back your improvements
#
# Version: v3.2.0
# Version: v3.5.0
####### Description #############
#
# Functions to check declarations
Expand Down Expand Up @@ -51,7 +51,7 @@
#
# # shellcheck disable=SC2317 # is passed by name to exitIfArgIsNotArrayWithTuples
# function describePair() {
# echo >&2 "array contains 2-tuples with names where the first value is the first-, and the second the lastname"
# echo >&2 "array contains 2-tuples with names where the first value is the first-, and the second the last name"
# }
# # check array with 2-tuples
# exitIfArgIsNotArrayWithTuples arr 2 "names" 1 describePair
Expand All @@ -70,6 +70,10 @@
# # meant to be used in a file which is sourced where a contract exists between the file which `source`s and the sourced file
# exitIfVarsNotAlreadySetBySource myVar1 var2 var3
#
# declare myVar4
# exitIfVariablesNotDeclared myVar4 myVar5 # would exit because myVar5 is not set
# echo "myVar4 $myVar4"
#
###################################
set -euo pipefail
shopt -s inherit_errexit
Expand All @@ -92,7 +96,7 @@ function checkArgIsArray() {
fi
local -rn checkArgIsArray_arr=$1
local -r argNumberOrName=$2
shift 2 || die "could not shift by 2"
shift 2 || traceAndDie "could not shift by 2"

reg='^declare -a.*'
local arrayDefinition
Expand All @@ -117,9 +121,9 @@ function exitIfArgIsNotArrayOrIsEmpty() {
exitIfArgIsNotArray "$@"
local -rn exitIfArgIsNotArrayOrIsEmpty_arr=$1
local -r argNumberOrName=$2
shift 2 || die "could not shift by 2"
shift 2 || traceAndDie "could not shift by 2"
if [[ ${#exitIfArgIsNotArrayOrIsEmpty_arr[@]} -lt 1 ]]; then
die "the passed argument \033[0;36m%s\033[0m is an empty array" "${!checkArgIsArray_arr}"
traceAndDie "the passed argument \033[0;36m%s\033[0m is an empty array" "${!checkArgIsArray_arr}"
fi
}

Expand All @@ -140,7 +144,7 @@ function checkArgIsArrayWithTuples() {
local -r tupleRepresents=$3
local -r argNumberOrName=$4
local -r describeTupleFn=$5
shift 5 || die "could not shift by 5"
shift 5 || traceAndDie "could not shift by 5"

local -r arrLength=${#checkArgIsArrayWithTuples_paramArr[@]}

Expand All @@ -152,7 +156,7 @@ function checkArgIsArrayWithTuples() {
fi

local arrayDefinition
arrayDefinition=$(recursiveDeclareP checkArgIsArrayWithTuples_paramArr) || die "could not get array definition of %s" "${!checkArgIsArrayWithTuples_paramArr}"
arrayDefinition=$(recursiveDeclareP checkArgIsArrayWithTuples_paramArr) || traceAndDie "could not get array definition of %s" "${!checkArgIsArrayWithTuples_paramArr}"
reg='declare -a.*'
if ! [[ "$arrayDefinition" =~ $reg ]]; then
logError "the passed array \033[0;36m%s\033[0m is broken" "${!checkArgIsArrayWithTuples_paramArr}"
Expand Down Expand Up @@ -254,7 +258,7 @@ function exitIfArgIsNotVersion() {

function checkArgIsVersion() {
local versionRegex
source "$dir_of_tegonal_scripts/releasing/common-constants.source.sh" || die "could not source common-constants.source.sh"
source "$dir_of_tegonal_scripts/releasing/common-constants.source.sh" || traceAndDie "could not source common-constants.source.sh"

local value argNumberOrName
# shellcheck disable=SC2034 # is passed by name to parseFnArgs
Expand Down Expand Up @@ -291,7 +295,18 @@ function exitIfCommandDoesNotExist() {
function exitIfVarsNotAlreadySetBySource() {
for varName in "$@"; do
if ! [[ -v "$varName" ]] || [[ -z ${!varName} ]]; then
die "looks like \$%s was not defined by %s where this file (%s) was sourced" "$varName" "${BASH_SOURCE[2]:-${BASH_SOURCE[1]}}" "${BASH_SOURCE[0]}"
traceAndDie "looks like \$%s was not defined by %s where this file (%s) was sourced" "$varName" "${BASH_SOURCE[2]:-${BASH_SOURCE[1]}}" "${BASH_SOURCE[0]}"
fi
done
}

function exitIfVariablesNotDeclared() {
shift 1 || traceAndDie "could not shift by 1"
for variableName in "$@"; do
if ! declare -p "$variableName" 2>/dev/null | grep -q 'declare --'; then
logError "you need to \`declare\` (\`local\`) the variable \033[0;36m%s\033[0m otherwise we write to the global scope (you can also \`declare\` it in the global scope)" "$variableName"
printStackTrace
exit 1
fi
done
}
Loading

0 comments on commit 4ecbd12

Please sign in to comment.