mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-01-26 11:14:08 +00:00
chore(lint): Linted scripts, yaml and configs
This commit is contained in:
@@ -6,7 +6,6 @@
|
||||
# Helper env variables. Use like this: VERBOSE=1 ./script.sh
|
||||
: "${VERBOSE:=0}"
|
||||
|
||||
|
||||
# -- Colors -- #
|
||||
CLR_RED="\033[1;31m"
|
||||
CLR_YELLOW="\033[1;33m"
|
||||
@@ -254,11 +253,11 @@ function replacable()
|
||||
|
||||
[[ ! -r "$FILE1" ]] && {
|
||||
[[ $VERBOSE -eq 1 ]] && msg_err "File 1 ($FILE1) does not exist"
|
||||
return 0;
|
||||
return 0
|
||||
}
|
||||
[[ ! -r "$FILE2" ]] && {
|
||||
[[ $VERBOSE -eq 1 ]] && msg_err "File 2 ($FILE2) does not exist, replacable"
|
||||
return 1;
|
||||
return 1
|
||||
}
|
||||
|
||||
FILE1_HASH=$(get_sha256sum "$FILE1")
|
||||
@@ -266,20 +265,19 @@ function replacable()
|
||||
|
||||
[[ $FILE1_HASH = "" ]] && {
|
||||
[[ $VERBOSE -eq 1 ]] && msg_err "Could not get hash for file 1 ($FILE1)"
|
||||
return 0;
|
||||
return 0
|
||||
}
|
||||
[[ $FILE2_HASH = "" ]] && {
|
||||
[[ $VERBOSE -eq 1 ]] && msg_err "Could not get hash for file 2 ($FILE2), replacable"
|
||||
return 1;
|
||||
return 1
|
||||
}
|
||||
|
||||
[[ "$FILE1_HASH" == "$FILE2_HASH" ]] && {
|
||||
[[ $VERBOSE -eq 1 ]] && msg_ok "Files match, not replacable: $FILE1"
|
||||
return 0;
|
||||
return 0
|
||||
}
|
||||
|
||||
[[ $VERBOSE -eq 1 ]] && msg_warn "Files do not match ($FILE1_HASH != $FILE2_HASH), replacable"
|
||||
|
||||
return 1;
|
||||
return 1
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user