refactor: Removed hardcoded colors.

This commit is contained in:
2026-06-29 15:07:50 -04:00
parent c3e667e7bc
commit 17d7fb5eb6
10 changed files with 134 additions and 161 deletions
+7 -21
View File
@@ -4,7 +4,6 @@ import "core:encoding/json"
import "core:fmt"
import "core:os"
import "core:terminal"
import "core:terminal/ansi"
cmd_scan :: proc(cmd: ^Command) {
db, db_ok := db_open(cmd.flags.config_file)
@@ -72,11 +71,7 @@ cmd_scan :: proc(cmd: ^Command) {
selected, result := multi_select("Select .env files to backup:", files[:])
defer delete(selected)
if result == .Cancel {
fmt.wprintln(
cmd.out,
ansi.CSI + ansi.FAINT + ansi.SGR + "Cancelled." + ANSI_RESET,
flush = false,
)
fmt.wprintln(cmd.out, colorize(.Message, "Cancelled."), flush = false)
return
}
@@ -100,25 +95,16 @@ cmd_scan :: proc(cmd: ^Command) {
}
if added_count > 0 {
fmt.wprintf(
fmt.wprintln(
cmd.out,
ansi.CSI +
ansi.BOLD +
";" +
ansi.FG_GREEN +
ansi.SGR +
"Successfully added %d file(s) to backup." +
ANSI_RESET +
"\n",
added_count,
colorize(
.Sucess,
fmt.tprintf("Successfully added %d file(s) to backup.", added_count),
),
flush = false,
)
} else {
fmt.wprintln(
cmd.out,
ansi.CSI + ansi.FAINT + ansi.SGR + "No files were added." + ANSI_RESET,
flush = false,
)
fmt.wprintln(cmd.out, colorize(.Message, "No files were added."), flush = false)
}
}