Files

26 lines
621 B
Go
Raw Permalink Normal View History

2015-05-28 15:56:48 +02:00
package main
import (
2015-05-29 21:10:33 +02:00
"fmt"
"github.com/edindazdarevic/confighub/chub/client"
"github.com/edindazdarevic/confighub/chub/globals"
"os"
"runtime"
2015-05-28 15:56:48 +02:00
)
func initCommand(guid string) {
configuration := config{MachineGuid: guid}
saveGuidToHomedir(configuration)
2015-05-28 15:56:48 +02:00
hostname, err := os.Hostname()
globals.PanicWithStyle("Something is terribly wrong. I am sorry. I am so so sorry. :~(", err)
machineToInitialize := client.Machine{hostname, runtime.GOOS, runtime.GOARCH, guid}
finishedOk := client.Init(&machineToInitialize)
2015-05-29 21:10:33 +02:00
if finishedOk {
fmt.Printf("Successfuly initialized the machine with id %v\n", guid)
}
}