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

Method otherBinScaffolding

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

Source from the content-addressed store, hash-verified

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

Callers 1

CreateMethod · 0.95

Calls 4

JoinMethod · 0.80
writeFileFunction · 0.70
ForRepoMethod · 0.65
CommandOutputMethod · 0.65

Tested by

no test coverage detected