Skip to content

Commit 0c6687a

Browse files
committed
Update 1.4 Fix Bad ASCII
1 parent c8f0825 commit 0c6687a

4 files changed

Lines changed: 6 additions & 1 deletion

File tree

build/Winfetch-Installer-1.4.exe

3.9 MB
Binary file not shown.

build/Winfetch-Installer.exe

-3.9 MB
Binary file not shown.

main.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"strings"
77
"bufio"
88
"os/user"
9+
"unicode/utf8"
910
"os"
1011
"encoding/json"
1112
"io/ioutil"
@@ -167,7 +168,11 @@ func main() {
167168
}
168169
index := 0
169170
for i, str := range s {
170-
fmt.Println(xterm256.Sprint(ascii, winArtResult[i]) + " " + str)
171+
if len(winArtResult) - 1 < i {
172+
fmt.Println(strings.Repeat(" ", utf8.RuneCountInString(winArtResult[0])) + " " + str)
173+
} else {
174+
fmt.Println(xterm256.Sprint(ascii, winArtResult[i]) + " " + str)
175+
}
171176
}
172177
for scanner.Scan() {
173178
if index >= len(s) {

0 commit comments

Comments
 (0)