mirror of
https://github.com/tw93/Mole.git
synced 2026-02-12 21:35:14 +00:00
chore: auto format code
This commit is contained in:
@@ -402,7 +402,10 @@ main() {
|
|||||||
if [[ ${#CURRENT_WHITELIST_PATTERNS[@]} -gt 0 ]]; then
|
if [[ ${#CURRENT_WHITELIST_PATTERNS[@]} -gt 0 ]]; then
|
||||||
local count=${#CURRENT_WHITELIST_PATTERNS[@]}
|
local count=${#CURRENT_WHITELIST_PATTERNS[@]}
|
||||||
if [[ $count -le 3 ]]; then
|
if [[ $count -le 3 ]]; then
|
||||||
local patterns_list=$(IFS=', '; echo "${CURRENT_WHITELIST_PATTERNS[*]}")
|
local patterns_list=$(
|
||||||
|
IFS=', '
|
||||||
|
echo "${CURRENT_WHITELIST_PATTERNS[*]}"
|
||||||
|
)
|
||||||
echo -e "${ICON_ADMIN} Active Whitelist: ${patterns_list}"
|
echo -e "${ICON_ADMIN} Active Whitelist: ${patterns_list}"
|
||||||
else
|
else
|
||||||
echo -e "${ICON_ADMIN} Active Whitelist: ${GRAY}${count} items${NC}"
|
echo -e "${ICON_ADMIN} Active Whitelist: ${GRAY}${count} items${NC}"
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ func getMoleFrame(animFrame int, termWidth int) string {
|
|||||||
var body []string
|
var body []string
|
||||||
var bodyIdx int
|
var bodyIdx int
|
||||||
isChristmas := isChristmasSeason()
|
isChristmas := isChristmasSeason()
|
||||||
|
|
||||||
if isChristmas {
|
if isChristmas {
|
||||||
bodyIdx = animFrame % len(moleBodyWithHat)
|
bodyIdx = animFrame % len(moleBodyWithHat)
|
||||||
body = moleBodyWithHat[bodyIdx]
|
body = moleBodyWithHat[bodyIdx]
|
||||||
@@ -138,7 +138,7 @@ func getMoleFrame(animFrame int, termWidth int) string {
|
|||||||
|
|
||||||
padding := strings.Repeat(" ", pos)
|
padding := strings.Repeat(" ", pos)
|
||||||
var lines []string
|
var lines []string
|
||||||
|
|
||||||
if isChristmas {
|
if isChristmas {
|
||||||
// Render with red hat on first 3 lines
|
// Render with red hat on first 3 lines
|
||||||
for i, line := range body {
|
for i, line := range body {
|
||||||
@@ -153,7 +153,7 @@ func getMoleFrame(animFrame int, termWidth int) string {
|
|||||||
lines = append(lines, padding+line)
|
lines = append(lines, padding+line)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return strings.Join(lines, "\n")
|
return strings.Join(lines, "\n")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ is_christmas_season() {
|
|||||||
local month day
|
local month day
|
||||||
month=$(date +%-m)
|
month=$(date +%-m)
|
||||||
day=$(date +%-d)
|
day=$(date +%-d)
|
||||||
|
|
||||||
# December 10 to December 31
|
# December 10 to December 31
|
||||||
if [[ $month -eq 12 && $day -ge 10 && $day -le 31 ]]; then
|
if [[ $month -eq 12 && $day -ge 10 && $day -le 31 ]]; then
|
||||||
return 0
|
return 0
|
||||||
|
|||||||
@@ -16,10 +16,10 @@ format_app_display() {
|
|||||||
[[ "$size" != "0" && "$size" != "" && "$size" != "Unknown" ]] && size_str="$size"
|
[[ "$size" != "0" && "$size" != "" && "$size" != "Unknown" ]] && size_str="$size"
|
||||||
|
|
||||||
# Calculate available width for app name based on terminal width
|
# Calculate available width for app name based on terminal width
|
||||||
local terminal_width=$(tput cols 2>/dev/null || echo 80)
|
local terminal_width=$(tput cols 2> /dev/null || echo 80)
|
||||||
local fixed_width=28
|
local fixed_width=28
|
||||||
local available_width=$((terminal_width - fixed_width))
|
local available_width=$((terminal_width - fixed_width))
|
||||||
|
|
||||||
# Set reasonable bounds for name width: 24-35 chars
|
# Set reasonable bounds for name width: 24-35 chars
|
||||||
[[ $available_width -lt 24 ]] && available_width=24
|
[[ $available_width -lt 24 ]] && available_width=24
|
||||||
[[ $available_width -gt 35 ]] && available_width=35
|
[[ $available_width -gt 35 ]] && available_width=35
|
||||||
|
|||||||
Reference in New Issue
Block a user