Enforce colorized output for QR code.

test/ssh
Icedream 2017-09-04 11:53:17 +02:00
parent c7bd31c631
commit b6b245c65e
Signed by: icedream
GPG Key ID: 1573F6D8EFE4D0CF
1 changed files with 3 additions and 0 deletions

View File

@ -5,6 +5,7 @@ import (
"io" "io"
"log" "log"
"github.com/fatih/color"
"github.com/gliderlabs/ssh" "github.com/gliderlabs/ssh"
"github.com/qpliu/qrencode-go/qrencode" "github.com/qpliu/qrencode-go/qrencode"
@ -14,6 +15,8 @@ import (
func main() { func main() {
greeting := "https://git.icedream.tech/icedream/pixelqr" greeting := "https://git.icedream.tech/icedream/pixelqr"
color.NoColor = false
ssh.Handle(func(s ssh.Session) { ssh.Handle(func(s ssh.Session) {
grid, err := qrencode.Encode(greeting, qrencode.ECLevelQ) grid, err := qrencode.Encode(greeting, qrencode.ECLevelQ)
if err != nil { if err != nil {