MCPcopy Create free account
hub / github.com/dotzero/git-profile / check

Function check

cmd/check.go:11–23  ·  view source on GitHub ↗
(cmd *cobra.Command, cfg storage, v vcs)

Source from the content-addressed store, hash-verified

9)
10
11func check(cmd *cobra.Command, cfg storage, v vcs) {
12 if !v.IsRepository() {
13 ui.PrintErrln(cmd, ui.ErrorStyle, "The current working directory is not a valid git repository.")
14 os.Exit(1)
15 }
16
17 if cfg.Len() == 0 {
18 ui.PrintErrln(cmd, ui.ErrorStyle, `There are no available profiles.`)
19 ui.Println(cmd, ui.SuccessStyle, `To add a new profile, use the following command:`)
20 ui.Println(cmd, ui.DefaultStyle, `$ git-profile add`)
21 os.Exit(0)
22 }
23}

Callers 4

CurrentFunction · 0.85
useCommandFunction · 0.85
unuseCommandFunction · 0.85
ListFunction · 0.85

Calls 4

PrintErrlnFunction · 0.92
PrintlnFunction · 0.92
IsRepositoryMethod · 0.65
LenMethod · 0.65

Tested by

no test coverage detected