MCPcopy
hub / github.com/jesseduffield/lazygit / UpdateFile

Method UpdateFile

pkg/integration/components/shell.go:127–135  ·  view source on GitHub ↗
(path string, content string)

Source from the content-addressed store, hash-verified

125}
126
127func (self *Shell) UpdateFile(path string, content string) *Shell {
128 fullPath := filepath.Join(self.dir, path)
129 err := os.WriteFile(fullPath, []byte(content), 0o644)
130 if err != nil {
131 self.fail(fmt.Sprintf("error updating file: %s\n%s", fullPath, err))
132 }
133
134 return self
135}
136
137func (self *Shell) NewBranch(name string) *Shell {
138 return self.RunCommand([]string{"git", "checkout", "-b", name})

Calls 2

failMethod · 0.80
SprintfMethod · 0.65

Tested by

no test coverage detected