feat: warn user about chafa
This commit is contained in:
parent
fa5f941418
commit
fb397912e4
@ -129,15 +129,13 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fallbackToAscii := func(path *string) []string {
|
fallbackToAscii := func(path *string) []string {
|
||||||
|
fmt.Println("chafa binary not found, chafa is the dependency of gogofetch, please install it")
|
||||||
parts := strings.Split(*path, ".")
|
parts := strings.Split(*path, ".")
|
||||||
if len(parts) > 1 {
|
if len(parts) > 1 {
|
||||||
parts[len(parts)-1] = "txt"
|
parts[len(parts)-1] = "txt"
|
||||||
}
|
}
|
||||||
*path = strings.Join(parts, ".")
|
*path = strings.Join(parts, ".")
|
||||||
|
|
||||||
if !strings.HasSuffix(*path, ".txt") {
|
|
||||||
fmt.Println("chafa binary not found, to print images please install chafa")
|
|
||||||
}
|
|
||||||
return providers.SplitLines(providers.PrintAsciiLogo(*path))
|
return providers.SplitLines(providers.PrintAsciiLogo(*path))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user