MCPcopy Create free account
hub / github.com/github/gh-aw / buildCopilotSettingsSetup

Function buildCopilotSettingsSetup

pkg/workflow/copilot_engine_execution.go:76–86  ·  view source on GitHub ↗

buildCopilotSettingsSetup returns shell commands that write the Copilot CLI settings file before the agent runs, disabling the rubber-duck sub-agent.

(settingsContent string, fixOwnershipForCustomCommand bool)

Source from the content-addressed store, hash-verified

74// buildCopilotSettingsSetup returns shell commands that write the Copilot CLI settings
75// file before the agent runs, disabling the rubber-duck sub-agent.
76func buildCopilotSettingsSetup(settingsContent string, fixOwnershipForCustomCommand bool) string {
77 if settingsContent == "" {
78 settingsContent = copilotSettingsDefaultContent
79 }
80 setup := "mkdir -p \"$HOME/.copilot\"\n"
81 if fixOwnershipForCustomCommand {
82 setup += "sudo chown -R \"$(id -u):$(id -g)\" \"$HOME/.copilot\"\n"
83 }
84 return setup + fmt.Sprintf("printf '%%s' %s > \"%s\"\n",
85 shellEscapeArg(settingsContent), copilotSettingsPath)
86}
87
88// buildCopilotSettingsCleanupTrap returns a shell trap command that removes the
89// temporary Copilot settings file at step exit. The trap body is single-quoted so

Calls 1

shellEscapeArgFunction · 0.85