mirror of
https://github.com/safedep/pmg.git
synced 2026-08-03 07:24:09 +02:00
chore: README update demo and Error Fix (#126)
* docs: Update README with demo gif * fix: Proxy remove dependency on interaction * fix: Update demo gif width * Update docs/demo/pmg-intro.tape Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Abhisek Datta <abhisek.datta@gmail.com> * fix: PMG demo --------- Signed-off-by: Abhisek Datta <abhisek.datta@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -33,13 +33,9 @@ func ErrorExit(err error) {
|
||||
}
|
||||
|
||||
// printMinimalError prints error in minimal two-line format:
|
||||
// Line 1: Error code (red background) + message (red)
|
||||
// Line 2: Actionable hint with arrow prefix (dimmed)
|
||||
func printMinimalError(code, message, hint string) {
|
||||
// Line 1: Error code + message
|
||||
fmt.Printf("%s %s\n", Colors.ErrorCode(" %s ", code), Colors.Red(message))
|
||||
|
||||
// Line 2: Actionable hint with arrow (only if meaningful)
|
||||
if hint != "" && hint != "No additional help is available for this error." {
|
||||
fmt.Printf(" %s %s\n", Colors.Dim("→"), Colors.Dim(hint))
|
||||
}
|
||||
|
||||
@@ -76,7 +76,6 @@ var errorMatchers = []errorMatcher{
|
||||
WithCode(usefulerror.ErrCodeLifecycle).
|
||||
WithHumanError(fmt.Sprintf("Command failed with exit code %d", exitCode)).
|
||||
WithHelp("Check command output above").
|
||||
WithAdditionalHelp("Run with PMG_DEBUG=true for more details").
|
||||
Wrap(err)
|
||||
},
|
||||
},
|
||||
|
||||
+12
-1
@@ -54,6 +54,14 @@ func ClearStatus() {
|
||||
}
|
||||
|
||||
func Block(config *BlockConfig) error {
|
||||
return blockWithExit(config, true)
|
||||
}
|
||||
|
||||
func BlockNoExit(config *BlockConfig) error {
|
||||
return blockWithExit(config, false)
|
||||
}
|
||||
|
||||
func blockWithExit(config *BlockConfig, exit bool) error {
|
||||
StopSpinner()
|
||||
|
||||
fmt.Println()
|
||||
@@ -64,7 +72,10 @@ func Block(config *BlockConfig) error {
|
||||
}
|
||||
|
||||
fmt.Println()
|
||||
os.Exit(1)
|
||||
|
||||
if exit {
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user