diff --git a/pkg/app/app.go b/pkg/app/app.go index 9d3f53cc0..a533e6c64 100644 --- a/pkg/app/app.go +++ b/pkg/app/app.go @@ -192,10 +192,20 @@ func (app *App) setupRepo() (bool, error) { return false, err // Current directory appears to be a git repository. } - // Offer to initialize a new repository in current directory. - fmt.Print(app.Tr.CreateRepo) - response, _ := bufio.NewReader(os.Stdin).ReadString('\n') - if strings.Trim(response, " \n") != "y" { + shouldInitRepo := true + notARepository := app.Config.GetUserConfig().NotARepository + if(notARepository == "prompt") { + // Offer to initialize a new repository in current directory. + fmt.Print(app.Tr.CreateRepo) + response, _ := bufio.NewReader(os.Stdin).ReadString('\n') + if strings.Trim(response, " \n") != "y" { + shouldInitRepo = false + } + } else if(notARepository == "skip") { + shouldInitRepo = false + } + + if !shouldInitRepo { // check if we have a recent repo we can open recentRepos := app.Config.GetAppState().RecentRepos if len(recentRepos) > 0 { diff --git a/pkg/config/user_config.go b/pkg/config/user_config.go index 5891071b7..6fc28f101 100644 --- a/pkg/config/user_config.go +++ b/pkg/config/user_config.go @@ -14,6 +14,7 @@ type UserConfig struct { DisableStartupPopups bool `yaml:"disableStartupPopups"` CustomCommands []CustomCommand `yaml:"customCommands"` Services map[string]string `yaml:"services"` + NotARepository string `yaml:"notARepository"` } type GuiConfig struct { @@ -442,5 +443,6 @@ func GetDefaultConfig() *UserConfig { DisableStartupPopups: false, CustomCommands: []CustomCommand(nil), Services: map[string]string(nil), + NotARepository: "prompt", } }