-
-
Notifications
You must be signed in to change notification settings - Fork 266
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add wipe sub-command that remove local bugs and identities
- Loading branch information
Showing
10 changed files
with
180 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package commands | ||
|
||
import ( | ||
"github.com/MichaelMure/git-bug/entities/bug" | ||
"github.com/MichaelMure/git-bug/entities/identity" | ||
|
||
"github.com/spf13/cobra" | ||
|
||
"github.com/MichaelMure/git-bug/commands/execenv" | ||
) | ||
|
||
func newWipeCommand() *cobra.Command { | ||
env := execenv.NewEnv() | ||
|
||
cmd := &cobra.Command{ | ||
Use: "wipe", | ||
Short: "Wipe git-bug from git repository", | ||
Long: "Wipe git-bug from git repository", | ||
PreRunE: execenv.LoadRepo(env), | ||
RunE: execenv.CloseBackend(env, func(cmd *cobra.Command, args []string) error { | ||
return runWipe(env) | ||
}), | ||
} | ||
|
||
return cmd | ||
} | ||
|
||
func runWipe(env *execenv.Env) error { | ||
|
||
env.Out.Println("cleaning bugs..") | ||
err := bug.RemoveAll(env.Repo) | ||
if err != nil { | ||
return err | ||
} | ||
env.Out.Println("cleaning identities..") | ||
err = identity.RemoveAll(env.Repo) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
.nh | ||
.TH "GIT-BUG" "1" "Apr 2019" "Generated from git-bug's source code" "" | ||
|
||
.SH NAME | ||
.PP | ||
git-bug-wipe - Wipe git-bug from git repository | ||
|
||
|
||
.SH SYNOPSIS | ||
.PP | ||
\fBgit-bug wipe [flags]\fP | ||
|
||
|
||
.SH DESCRIPTION | ||
.PP | ||
Wipe git-bug from git repository | ||
|
||
|
||
.SH OPTIONS | ||
.PP | ||
\fB-h\fP, \fB--help\fP[=false] | ||
help for wipe | ||
|
||
|
||
.SH SEE ALSO | ||
.PP | ||
\fBgit-bug(1)\fP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
## git-bug wipe | ||
|
||
Wipe git-bug from git repository | ||
|
||
### Synopsis | ||
|
||
Wipe git-bug from git repository | ||
|
||
``` | ||
git-bug wipe [flags] | ||
``` | ||
|
||
### Options | ||
|
||
``` | ||
-h, --help help for wipe | ||
``` | ||
|
||
### SEE ALSO | ||
|
||
* [git-bug](git-bug.md) - A bug tracker embedded in Git | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters