mirror of
https://github.com/nix-community/disko.git
synced 2026-12-01 21:43:29 +01:00
disko2: Split into modules
This commit is contained in:
1 parent
94806e4506
commit
62581f38f5
5 files changed
+97
-93
No files matched your search
@@ -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)"
|
||||
}
|
||||
Reference in new issue
Block a user