fix(repo): use prerun hook

Co-authored-by: Clement Sam <clementsam75@gmail.com>
This commit is contained in:
Peter Benjamin 2020-12-30 09:10:00 -08:00
parent 5e2e549e19
commit 63e0971f63
1 changed files with 9 additions and 9 deletions

View File

@ -27,16 +27,16 @@ func NewCmdRepo(f *cmdutils.Factory) *cobra.Command {
Short: `Work with GitLab repositories and projects`,
Long: ``,
Aliases: []string{"project"},
RunE: func(cmd *cobra.Command, args []string) error {
cfg, err := f.Config()
if err != nil {
return err
}
baseRepo, err := f.BaseRepo()
if err != nil {
return err
}
PreRunE: func(cmd *cobra.Command, args []string) error {
if opts.OpenInBrowser {
cfg, err := f.Config()
if err != nil {
return err
}
baseRepo, err := f.BaseRepo()
if err != nil {
return err
}
browser, err := cfg.Get(baseRepo.RepoHost(), "browser")
if err != nil {
return err