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

Function shellJoinArgs

pkg/workflow/shell.go:15–24  ·  view source on GitHub ↗

shellJoinArgs joins command arguments with proper shell escaping. Arguments containing ${{ }} GitHub Actions expressions are double-quoted; other arguments with special shell characters are single-quoted.

(args []string)

Source from the content-addressed store, hash-verified

13// Arguments containing ${{ }} GitHub Actions expressions are double-quoted;
14// other arguments with special shell characters are single-quoted.
15func shellJoinArgs(args []string) string {
16 shellLog.Printf("Joining %d shell arguments with escaping", len(args))
17 var escapedArgs []string
18 for _, arg := range args {
19 escapedArgs = append(escapedArgs, shellEscapeArg(arg))
20 }
21 result := strings.Join(escapedArgs, " ")
22 shellLog.Print("Shell arguments joined successfully")
23 return result
24}
25
26// shellEscapeArg escapes a single argument for safe use in shell commands.
27// Arguments containing ${{ }} GitHub Actions expressions are double-quoted;

Callers 9

GetExecutionStepsMethod · 0.85
BuildAWFCommandFunction · 0.85
GetExecutionStepsMethod · 0.85
GetExecutionStepsMethod · 0.85
GetExecutionStepsMethod · 0.85
TestShellJoinArgsFunction · 0.85

Calls 3

shellEscapeArgFunction · 0.85
PrintMethod · 0.80
PrintfMethod · 0.45

Tested by 1

TestShellJoinArgsFunction · 0.68