MCPcopy Create free account
hub / github.com/cli/cli / otherBinScaffolding

Method otherBinScaffolding

pkg/cmd/extension/manager.go:641–664  ·  view source on GitHub ↗
(name string)

Source from the content-addressed store, hash-verified

639}
640
641func (m *Manager) otherBinScaffolding(name string) error {
642 if err := writeFile(filepath.Join(name, ".github", "workflows", "release.yml"), otherBinWorkflow, 0644); err != nil {
643 return err
644 }
645 buildScriptPath := filepath.Join("script", "build.sh")
646 if err := writeFile(filepath.Join(name, buildScriptPath), buildScript, 0755); err != nil {
647 return err
648 }
649
650 scopedClient := m.gitClient.ForRepo(name)
651 if _, err := scopedClient.CommandOutput([]string{"add", buildScriptPath, "--chmod=+x"}); err != nil {
652 return err
653 }
654
655 if _, err := scopedClient.CommandOutput([]string{"add", "."}); err != nil {
656 return err
657 }
658
659 if _, err := scopedClient.CommandOutput([]string{"commit", "-m", "initial commit"}); err != nil {
660 return ErrInitialCommitFailed
661 }
662
663 return nil
664}
665
666func (m *Manager) goBinScaffolding(name string) error {
667 goExe, err := m.lookPath("go")

Callers 1

CreateMethod · 0.95

Calls 4

writeFileFunction · 0.85
JoinMethod · 0.80
ForRepoMethod · 0.65
CommandOutputMethod · 0.65

Tested by

no test coverage detected