mirror of
https://github.com/sbrow/envr.git
synced 2026-08-26 09:53:32 -04:00
refactor: Removed hardcoded colors.
This commit is contained in:
+7
-21
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user