Skip to content

Commit

Permalink
update to fixed version 4.1.0 of tegonal-scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
robstoll committed Oct 26, 2024
1 parent 4cf303f commit 9ffb9d0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .gt/remotes/tegonal-scripts/pulled.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ v4.1.0 src/utility/log.sh ../lib/tegonal-scripts/src/utility/log.sh 46f93eb32ec5
v4.1.0 src/utility/parse-fn-args.sh ../lib/tegonal-scripts/src/utility/parse-fn-args.sh 6a7b9a1155ac735947287aba434a57aa7b7d9f03ed9fd1892534dd997a7bb1a47772aeaf4c3d03abeca6c5488474a98bf5c1ee0d132d54be94d7bcfeaf238166
v4.1.0 src/utility/update-bash-docu.sh ../lib/tegonal-scripts/src/utility/update-bash-docu.sh 0d83945d75de6a5b3b3ebee075f7fc62672a4c3447c583343c14b51f228042ec26415d427ff4051d0d08a0819b203842093c143ab802b875f40c4f92287ebf1e
v4.1.0 src/utility/parse-args.sh ../lib/tegonal-scripts/src/utility/parse-args.sh 033fe2e847eddae72e801c5f3bc48f0533908b40ed82a5830be2b99b04d0e8449384db56581b20cc48b5508cb6b9e461ade4f42187dc95a28acdbf764d37f2db
v4.1.0 src/utility/checks.sh ../lib/tegonal-scripts/src/utility/checks.sh 007c47054aab54f51a0012918643bb37a26ef3637e48a613c69017d2cf0d6becf85d97bfd7472d5d29726374911ee24e529c53b06121db5409658165af674dd8
v4.1.0 src/utility/checks.sh ../lib/tegonal-scripts/src/utility/checks.sh 51514ae334e1539f239ead23092b0b6232575987ef85b656630f5a4d0276465f8bde18dc7252a32bec524244dc1ba98a21a33b3a4c63c49ac7f4491b10fd767d
v4.1.0 src/utility/parse-commands.sh ../lib/tegonal-scripts/src/utility/parse-commands.sh ba03b365515a534d1e90c6e4399267d11c326344e1ca2aeaea2a147d5640c8fc24c758b6d3189871af74e42597941a0e8a9cb81a44969b5d3023dbb487ef2251
v4.1.0 src/utility/replace-snippet.sh ../lib/tegonal-scripts/src/utility/replace-snippet.sh c897db71ec57f0a22af0c20bbcf88e276d960486270f1baaf0c2067fd3b808b21d9fdbc5e6892ac317014af46c353220ce6f7d6769e3d07092514a5c04077c43
v4.1.0 src/utility/ask.sh ../lib/tegonal-scripts/src/utility/ask.sh 9aa040b6ba76226ae78a8fd1b1050a2f3b6a617b148d765fcaf7535d0427944467fbf78d8a5390f240d2277db0da588438209f29a47b2d4b71983907868e191f
Expand Down
10 changes: 5 additions & 5 deletions lib/tegonal-scripts/src/utility/checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
#
# declare currentDir
# currentDir=$(pwd)
# checkIfPathNamedIsOutsideOf "$myVar4" "source directory" "$currentDir" # same as exitIfPathNamedIsOutsideOf if set -e has an effect on this line
# checkPathNamedIsInsideOf "$myVar4" "source directory" "$currentDir" # same as exitIfPathNamedIsOutsideOf if set -e has an effect on this line
# exitIfPathNamedIsOutsideOf "$myVar4/plugins.txt" "plugins" "$currentDir"
#
###################################
Expand Down Expand Up @@ -316,21 +316,21 @@ function exitIfVariablesNotDeclared() {
done
}

function checkIfPathNamedIsOutsideOf() {
function checkPathNamedIsInsideOf() {
local path name parentDirectory
# shellcheck disable=SC2034 # is passed by name to parseFnArgs
local -ra params=(path name parentDirectory)
parseFnArgs params "$@"

local pathAbsolute parentDirectoryAbsolute
pathAbsolute="$(realpath "$path")"
parentDirectoryAbsolute="$(realpath "$parentDirectory")"
pathAbsolute="$(realpath -m "$path")"
parentDirectoryAbsolute="$(realpath -m "$parentDirectory")"
if ! [[ "$pathAbsolute" == "$parentDirectoryAbsolute"* ]]; then
returnDying "the given \033[0;36m%s\033[0m %s is outside of %s" "$name" "$pathAbsolute" "$parentDirectory" || return $?
fi
}

function exitIfPathNamedIsOutsideOf() {
# shellcheck disable=SC2310 # we are aware of that || will disable set -e for checkIfPathNamedIsOutsideOf
checkIfPathNamedIsOutsideOf "$@" || exit $?
checkPathNamedIsInsideOf "$@" || exit $?
}
6 changes: 3 additions & 3 deletions src/gt-pull.sh
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ function gt_pull() {
workingDirAbsolute=$(readlink -m "$workingDir") || die "could not deduce workingDirAbsolute from %s" "$workingDir"
pullDirAbsolute=$(readlink -m "$pullDir")
local -r workingDirAbsolute pullDirAbsolute
checkIfPathNamedIsOutsideOf "$pullDirAbsolute" "pull directory" "$currentDir" || return $?
checkPathNamedIsInsideOf "$pullDirAbsolute" "pull directory" "$currentDir" || return $?

local publicKeysDir repo gpgDir pulledTsv pullHookFile
source "$dir_of_gt/paths.source.sh" || traceAndDie "could not source paths.source.sh"
Expand Down Expand Up @@ -398,7 +398,7 @@ function gt_pull() {
if [[ $entrySha != "$sha" ]]; then
logWarning "looks like the sha512 of \033[0;36m%s\033[0m changed in tag %s" "$repoFile" "$tagToPull"
gitDiffChars "$entrySha" "$sha"
printf "Won't pull the file, remove the entry from %s if you want to pull it nonetheless\n" "$pulledTsv"
printf "Won't pull the file, remove the entry from %s and \`gt pull\` if you want to pull it nonetheless\n" "$pulledTsv"
rm "$source"
return
elif ! grep -x "$entry" "$pulledTsv" >/dev/null; then
Expand Down Expand Up @@ -428,7 +428,7 @@ function gt_pull() {
while read -r -d $'\0' absoluteFile; do
# in theory this check should not be necessary as we already check that the pullDir is not outside
# but better be sure as we don't want that `gt re-pull` can be a security risk (leaving pull-hooks aside)
checkIfPathNamedIsOutsideOf "$absoluteFile" "target path" "$currentDir" || return $?
checkPathNamedIsInsideOf "$absoluteFile" "target path" "$currentDir" || return $?

local repoFile
repoFile=$(realpath --relative-to="$repo" "$absoluteFile")
Expand Down

0 comments on commit 9ffb9d0

Please sign in to comment.