-
-
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
1 parent
9c50a35
commit 3907cfe
Showing
25 changed files
with
413 additions
and
68 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
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
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,55 @@ | ||
package commands | ||
|
||
import ( | ||
"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 the git repository", | ||
PreRunE: execenv.LoadBackend(env), | ||
RunE: func(cmd *cobra.Command, args []string) error { | ||
return runWipe(env) | ||
}, | ||
} | ||
|
||
return cmd | ||
} | ||
|
||
func runWipe(env *execenv.Env) error { | ||
env.Out.Println("cleaning entities...") | ||
err := env.Backend.RemoveAll() | ||
if err != nil { | ||
return err | ||
} | ||
|
||
env.Out.Println("cleaning git config ...") | ||
err = env.Backend.ClearUserIdentity() | ||
if err != nil { | ||
return err | ||
} | ||
err = env.Backend.LocalConfig().RemoveAll("git-bug") | ||
if err != nil { | ||
return err | ||
} | ||
|
||
storage := env.Backend.LocalStorage() | ||
|
||
err = env.Backend.Close() | ||
if err != nil { | ||
return err | ||
} | ||
|
||
env.Out.Println("cleaning caches ...") | ||
err = storage.RemoveAll(".") | ||
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 the git repository | ||
|
||
|
||
.SH SYNOPSIS | ||
.PP | ||
\fBgit-bug wipe [flags]\fP | ||
|
||
|
||
.SH DESCRIPTION | ||
.PP | ||
Wipe git-bug from the 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,18 @@ | ||
## git-bug wipe | ||
|
||
Wipe git-bug from the 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
Oops, something went wrong.