fix(scripts): some typoes in scripts/shared.sh

This commit is contained in:
2024-06-25 01:23:22 +03:00
parent b9ddba4666
commit df5cab6a88

View File

@@ -133,12 +133,12 @@ function get_sha256sum()
sha256sum "$1" | head -c 64 sha256sum "$1" | head -c 64
} }
# Replacable file # Replaceable file
# #
# $1 - filename (string) # $1 - filename (string)
# $2 - filename (string) # $2 - filename (string)
# #
# Returns 1 when replacable, 0 when not replacable. # Returns 1 when replaceable, 0 when not replaceable.
function replacable() function replacable()
{ {
FILE1="$1" FILE1="$1"
@@ -149,7 +149,7 @@ function replacable()
return 0 return 0
} }
[[ ! -r "$FILE2" ]] && { [[ ! -r "$FILE2" ]] && {
[[ $VERBOSE -eq 1 ]] && msg_err "File 2 ($FILE2) does not exist, replacable" [[ $VERBOSE -eq 1 ]] && msg_err "File 2 ($FILE2) does not exist, replaceable"
return 1 return 1
} }
@@ -161,16 +161,16 @@ function replacable()
return 0 return 0
} }
[[ $FILE2_HASH = "" ]] && { [[ $FILE2_HASH = "" ]] && {
[[ $VERBOSE -eq 1 ]] && msg_err "Could not get hash for file 2 ($FILE2), replacable" [[ $VERBOSE -eq 1 ]] && msg_err "Could not get hash for file 2 ($FILE2), replaceable"
return 1 return 1
} }
[[ "$FILE1_HASH" == "$FILE2_HASH" ]] && { [[ "$FILE1_HASH" == "$FILE2_HASH" ]] && {
[[ $VERBOSE -eq 1 ]] && msg_ok "Files match, not replacable: $FILE1" [[ $VERBOSE -eq 1 ]] && msg_ok "Files match, not replaceable: $FILE1"
return 0 return 0
} }
[[ $VERBOSE -eq 1 ]] && msg_warn "Files do not match ($FILE1_HASH != $FILE2_HASH), replacable" [[ $VERBOSE -eq 1 ]] && msg_warn "Files do not match ($FILE1_HASH != $FILE2_HASH), replaceable"
return 1 return 1
} }