disko2: Split into modules

This commit is contained in:
Felix Uhl committed 2024-10-25 11:13:10 +02:00
1 parent 94806e4506
commit 62581f38f5
5 files changed
+97 -93

No files matched your search

+26
View File
@@ -0,0 +1,26 @@
use std log
export def exit-on-error [context: string] {
if $in.success {
log debug $"Success: ($context)"
log debug $"Return value: ($in.value)"
return $in.value
}
p_err $"Failed to ($context)!"
for msg in $in.messages {
print $"(ansi red)│(ansi reset) ($msg)"
}
print $"(ansi red)╰────────(ansi reset)"
exit 1
}
export def p_err [msg: string] {
print $"(ansi bg_red) ERROR: (ansi reset) ($msg)"
}
export def p_info [msg: string] {
print $"(ansi bg_green) INFO: (ansi reset) ($msg)"
}
export def p_help [msg: string] {
print $"(ansi bg_light_magenta) HELP: (ansi reset) ($msg)"
}