make some correction

This commit is contained in:
2023-11-29 12:57:49 -05:00
parent 70c9e72753
commit 8000ff69c9
11 changed files with 948 additions and 65 deletions
+15 -15
View File
@@ -7,6 +7,7 @@ import (
"kode-creator/utils"
"net/http"
"github.com/gookit/color"
"github.com/spf13/cobra"
)
@@ -55,10 +56,10 @@ func startList(cmd *cobra.Command, args []string) {
// if -o flag is set, list projects for that org
if CfgGlobal.GetListOrganizationFlag() {
if !CfgGlobal.GetJsonFlag() {
fmt.Println("\n L I S T P R O J E C T S F O R O R G. ")
fmt.Println(utils.CreateLine(8))
fmt.Println(" ==> " + CfgGlobal.GetListOrganization() + " <== ")
fmt.Println(utils.CreateLine(8))
color.Green.Println("\n L I S T P R O J E C T S F O R O R G. ")
color.Yellow.Println(utils.CreateLine(15))
color.Green.Println(" ==> " + CfgGlobal.GetListOrganization() + " <== ")
color.Yellow.Println(utils.CreateLine(15))
}
projects, err := ListGitTeaProjects(CfgGlobal.GetListOrganization())
if err != nil {
@@ -66,10 +67,9 @@ func startList(cmd *cobra.Command, args []string) {
return
}
for _, project := range projects {
fmt.Println(project)
// fmt.Print(project)
fmt.Print(project)
}
fmt.Println(utils.CreateLine(8))
color.Yellow.Println(utils.CreateLine(15))
} else {
orgs, err := ListGitTeaOrganization()
@@ -78,14 +78,14 @@ func startList(cmd *cobra.Command, args []string) {
return
}
if !CfgGlobal.GetJsonFlag() {
fmt.Println("\n L I S T O R G A N I Z A T I O N S")
fmt.Println(utils.CreateLine(8))
color.Green.Println("\n L I S T O R G A N I Z A T I O N S")
color.Yellow.Println(utils.CreateLine(15))
}
for _, org := range orgs {
fmt.Print(org)
}
fmt.Println(utils.CreateLine(8))
color.Yellow.Println(utils.CreateLine(15))
}
// if Github flag is set
@@ -94,8 +94,8 @@ func startList(cmd *cobra.Command, args []string) {
// if user flag is set, list projects for that user
if CfgGlobal.GetListUserFlag() {
fmt.Println("\n L I S T G I T H U B P R O J E C T S F O R : " + CfgGlobal.GetListUser())
fmt.Println(utils.CreateLine(11))
color.Green.Println("\n L I S T G I T H U B P R O J E C T S F O R : " + CfgGlobal.GetListUser())
color.Yellow.Println(utils.CreateLine(15))
repos, err := ListGitHubProjectsfromUser(CfgGlobal.GetListUser(), CfgGlobal.GetGithubTokenEnv())
if err != nil {
fmt.Println("Error:", err)
@@ -108,8 +108,8 @@ func startList(cmd *cobra.Command, args []string) {
}
} else if CfgGlobal.GetGitHubSearchFlag() {
fmt.Println("\n L I S T G I T H U B P R O J E C T S F R O M S E A R C H : " + CfgGlobal.GetListCmd().GitHubSearch)
fmt.Println(utils.CreateLine(11))
color.Green.Println("\n L I S T G I T H U B P R O J E C T S F R O M S E A R C H : " + CfgGlobal.GetListCmd().GitHubSearch)
color.Yellow.Println(utils.CreateLine(15))
repos, err := SearchGitHubProjectsfromSearch(CfgGlobal.GetListCmd().GitHubSearch, CfgGlobal.GetGithubTokenEnv())
if err != nil {
fmt.Println("Error:", err)
@@ -128,7 +128,7 @@ func startList(cmd *cobra.Command, args []string) {
// print help if no flag is set
cmd.Help()
fmt.Println(utils.CreateLine(11))
color.Yellow.Println(utils.CreateLine(15))
}