Skip to content

Commit

Permalink
use done as last column
Browse files Browse the repository at this point in the history
  • Loading branch information
mms-gianni committed Mar 3, 2021
1 parent 3c098e3 commit 3ee524d
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 21 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ git project add
git project status
```

### Cleanup all Cards in state "closed"
### Cleanup all Cards in column "done"
```
git project clean
```
Expand Down
2 changes: 1 addition & 1 deletion commands/clean.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ func cmdClean() *clif.Command {
githubcommands.Cleanup(c)
}

return clif.NewCommand("clean", "Archive all cards in the 'closed' column", cb)
return clif.NewCommand("clean", "Archive all cards in the 'done' column", cb)
}

func init() {
Expand Down
2 changes: 1 addition & 1 deletion commands/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

func cmdStatus() *clif.Command {
cb := func(c *clif.Command, out clif.Output) {
githubcommands.GetItems(c)
githubcommands.GetItems(c, out)
}

return clif.NewCommand("status", "List all projects and cards", cb).
Expand Down
14 changes: 7 additions & 7 deletions common/githubcommands.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func Cleanup(c *clif.Command) {

cards := getCards(client, project)
for _, card := range cards {
if card.GetColumnName() == "closed" {
if card.GetColumnName() == "done" {
fmt.Println("Archived", card.GetNote(), "in", project.GetName())
archived := true
client.Projects.UpdateProjectCard(ctx, card.GetID(), &github.ProjectCardOptions{Archived: &archived})
Expand Down Expand Up @@ -77,7 +77,7 @@ func CreateRepoProject(c *clif.Command, in clif.Input, repo *git.Repository) {
project, _, projectErr := client.Repositories.CreateProject(ctx, repositorydetails.owner, repositorydetails.name, &github.ProjectOptions{Name: &name, Body: &body, Public: &public})
if projectErr == nil {
client.Projects.CreateProjectColumn(ctx, project.GetID(), &github.ProjectColumnOptions{Name: "open"})
client.Projects.CreateProjectColumn(ctx, project.GetID(), &github.ProjectColumnOptions{Name: "closed"})
client.Projects.CreateProjectColumn(ctx, project.GetID(), &github.ProjectColumnOptions{Name: "done"})
}
}

Expand All @@ -103,20 +103,20 @@ func CreatePersonalProject(c *clif.Command, in clif.Input) {
}
client.Projects.UpdateProject(ctx, project.GetID(), &github.ProjectOptions{Body: &body, Public: &public})
client.Projects.CreateProjectColumn(ctx, project.GetID(), &github.ProjectColumnOptions{Name: "open"})
client.Projects.CreateProjectColumn(ctx, project.GetID(), &github.ProjectColumnOptions{Name: "closed"})
client.Projects.CreateProjectColumn(ctx, project.GetID(), &github.ProjectColumnOptions{Name: "done"})
}

}

func GetItems(c *clif.Command) {
func GetItems(c *clif.Command, out clif.Output) {
client := login(c)

for _, project := range getProjects(client) {
fmt.Println("\n\nList: ", project.GetName(), "("+project.GetState()+")")
fmt.Println("--------------------------------------")
out.Printf("\n\n<subline>List: " + project.GetName() + "<reset>\n")
cards := getCards(client, project)
for _, card := range cards {
fmt.Println(" <"+card.GetColumnName()+">", " ", card.GetNote())
//fmt.Println(" <"+card.GetColumnName()+">", " ", card.GetNote())
out.Printf(" <" + card.GetColumnName() + "> " + card.GetNote() + "\n")
}
}
}
Expand Down
25 changes: 14 additions & 11 deletions main/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,19 @@ func main() {
cli := clif.New("git-project", "DEV-VERSION", "Manage your github projects with git cli")

var OwnStyles = map[string]string{
"error": "\033[31;1m",
"warn": "\033[33m",
"info": "\033[0;97m",
"success": "\033[32m",
"debug": "\033[30;1m",
"headline": "\033[4;1m",
"subline": "\033[4m",
"important": "\033[47;30;1m",
"query": "\033[36m",
"reset": "\033[0m",
"error": "\033[31;1m",
"warn": "\033[33m",
"info": "\033[0;97m",
"success": "\033[32m",
"debug": "\033[30;1m",
"headline": "\033[4;1m",
"subline": "\033[4m",
"important": "\033[47;30;1m",
"query": "\033[36m",
"reset": "\033[0m",
"open": "\U00002B50",
"done": "\U00002705",
"in progress": "\U0001F528",
}

cli.SetOutput(clif.NewColorOutput(os.Stdout).SetFormatter(clif.NewDefaultFormatter(OwnStyles)))
Expand All @@ -49,7 +52,7 @@ U:Usage:R:
U:Available commands:R:
I:add R: Add a new card
I:clean R: Archive all cards in the 'closed' column
I:clean R: Archive all cards in the 'done' column
I:close R: Close a project
I:createR: Create a new project
I:help R: Show this help
Expand Down

0 comments on commit 3ee524d

Please sign in to comment.