Пример #1
0
func getClient() {
	// is there a token file?
	_, err := os.Stat(filepath.Join(tokenDir, tokenFile))
	if err != nil {
		fmt.Println("No previous authentication found.")
		cloud66.Authorize(tokenDir, tokenFile)
		os.Exit(1)
	} else {
		client = cloud66.GetClient(tokenDir, tokenFile, "")
		client.Debug = debugMode
	}
}
Пример #2
0
func initClients(c *cli.Context) {
	// is there a token file?
	_, err := os.Stat(filepath.Join(cxHome(), tokenFile))
	if err != nil {
		fmt.Println("No previous authentication found.")
		cloud66.Authorize(cxHome(), tokenFile)
		os.Exit(1)
	} else {
		client = cloud66.GetClient(cxHome(), tokenFile, VERSION)
		debugMode = c.GlobalBool("debug")
		client.Debug = debugMode
	}
}