~kris/9p

disco

0e15d4aa46c198b0ae7d69e8ca1f466e1673ede4 — Sean Hinchee 9 years ago 8de835d
made GetCons()
2 files changed, 13 insertions(+), 7 deletions(-)

M config.go
M helper.go
M config.go => config.go +2 -7
@@ 77,13 77,8 @@ func CreateConfig() {
	password := "";
	
	if plan9 {
		cons, err := os.OpenFile("/dev/cons", os.O_RDWR, 0600)
		if err != nil {
			fmt.Println("Failed to open /dev/cons")
		}
		consScan := bufio.NewScanner(cons)
		consScan.Scan()
		password = consScan.Text()
		
		password = GetCons()
	
		err = RawOff(consctl)
		if err != nil {

M helper.go => helper.go +11 -0
@@ 8,6 8,7 @@ import (
	"time"
	"fmt"
	"bitbucket.org/henesy/disco/DiscordGo"
	"bufio"
)

//HexColor is a struct gives RGB values


@@ 131,3 132,13 @@ func RawOff(consctl *os.File) error {
	consctl.Close()
	return nil
}

func GetCons() string {
	cons, err := os.OpenFile("/dev/cons", os.O_RDWR, 0600)
	if err != nil {
		fmt.Println("Failed to open /dev/cons")
	}
	consScan := bufio.NewScanner(cons)
	consScan.Scan()
	return consScan.Text()
}