示例#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
文件: main.go 项目: sgtpepper43/cx
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
	}
}