Add status command
This commit is contained in:
parent
2b4c6d3318
commit
e26879425f
9 changed files with 589 additions and 10 deletions
|
|
@ -10,7 +10,7 @@ import (
|
|||
const (
|
||||
APP_NAME = "Git repository manager"
|
||||
APP_DESCRIPTION = "Manage your repository with simple app"
|
||||
VERSION = "0.1.1"
|
||||
VERSION = "0.2.0"
|
||||
)
|
||||
|
||||
type GitRepositoryManager struct {
|
||||
|
|
@ -49,7 +49,6 @@ func (g *GitRepositoryManager) Parse(args []string) {
|
|||
|
||||
func (g *GitRepositoryManager) Run() {
|
||||
if g.cliArguments.Sync {
|
||||
|
||||
g.console.InfoFMsg("Synchronizing repositories")
|
||||
println()
|
||||
sync := commands.NewSynchronizer(g.configuration.Workspace)
|
||||
|
|
@ -58,6 +57,11 @@ func (g *GitRepositoryManager) Run() {
|
|||
g.console.InfoFMsg("All repositories are synced")
|
||||
}
|
||||
|
||||
if g.cliArguments.Status {
|
||||
status := commands.NewStatusChecker(g.configuration.Workspace)
|
||||
g.runCommand(status)
|
||||
}
|
||||
|
||||
if g.cliArguments.Version {
|
||||
g.console.InfoFMsg("Current version: %v", VERSION)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -90,5 +90,5 @@ func Example_test_sync_output() {
|
|||
// Output:
|
||||
// Info: Synchronizing repositories
|
||||
// Info: All repositories are synced
|
||||
// Info: Current version: 0.1.1
|
||||
// Info: Current version: 0.2.0
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ func (co ConsoleOutput) InfoFMsg(format string, a ...interface{}) {
|
|||
func (co ConsoleOutput) UnchangedStatusF(format string, a ...interface{}) {
|
||||
msg := fmt.Sprintf(format, a...)
|
||||
if co.Color {
|
||||
msg = fmt.Sprintf("%v%v", colorGreen, msg)
|
||||
msg = fmt.Sprintf("%v%v%v", colorGreen, msg, colorReset)
|
||||
}
|
||||
fmt.Println(msg)
|
||||
}
|
||||
|
|
@ -47,7 +47,7 @@ func (co ConsoleOutput) UnchangedStatusF(format string, a ...interface{}) {
|
|||
func (co ConsoleOutput) ChangedStatusF(format string, a ...interface{}) {
|
||||
msg := fmt.Sprintf(format, a...)
|
||||
if co.Color {
|
||||
msg = fmt.Sprintf("%v%v", colorYellow, msg)
|
||||
msg = fmt.Sprintf("%v%v%v", colorYellow, msg, colorReset)
|
||||
}
|
||||
fmt.Println(msg)
|
||||
}
|
||||
|
|
@ -55,7 +55,7 @@ func (co ConsoleOutput) ChangedStatusF(format string, a ...interface{}) {
|
|||
func (co ConsoleOutput) ErrorStatusF(format string, a ...interface{}) {
|
||||
msg := fmt.Sprintf(format, a...)
|
||||
if co.Color {
|
||||
msg = fmt.Sprintf("%v%v", colorRed, msg)
|
||||
msg = fmt.Sprintf("%v%v%v", colorRed, msg, colorReset)
|
||||
}
|
||||
fmt.Println(msg)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue