MCPcopy
hub / github.com/redspread/spread / Init

Method Init

cli/init.go:10–29  ·  view source on GitHub ↗

Init sets up a Spread repository for versioning.

()

Source from the content-addressed store, hash-verified

8
9// Init sets up a Spread repository for versioning.
10func (s SpreadCli) Init() *cli.Command {
11 return &cli.Command{
12 Name: "init",
13 Usage: "spread init <path>",
14 Description: "Create a new spread repository in the given directory. If none is given, the working directory will be used.",
15 Action: func(c *cli.Context) {
16 target := c.Args().First()
17 if len(target) == 0 {
18 target = project.SpreadDirectory
19 }
20
21 proj, err := project.InitProject(target)
22 if err != nil {
23 s.fatalf("Could not create Spread project: %v", err)
24 }
25
26 s.printf("Created Spread repository in %s.", proj.Path)
27 },
28 }
29}

Callers

nothing calls this directly

Calls 2

fatalfMethod · 0.95
printfMethod · 0.95

Tested by

no test coverage detected