(ctx context.Context, client *wsl.Distro, cmdTemplateRaw string, words map[string]string)
| 115 | } |
| 116 | |
| 117 | func makeCancellableCommand(ctx context.Context, client *wsl.Distro, cmdTemplateRaw string, words map[string]string) (*CancellableCmd, error) { |
| 118 | cmdContext, cmdCancel := context.WithCancel(ctx) |
| 119 | |
| 120 | cmdStr := &bytes.Buffer{} |
| 121 | cmdTemplate, err := template.New("").Parse(cmdTemplateRaw) |
| 122 | if err != nil { |
| 123 | cmdCancel() |
| 124 | return nil, err |
| 125 | } |
| 126 | cmdTemplate.Execute(cmdStr, words) |
| 127 | |
| 128 | cmd := client.WslCommand(cmdContext, cmdStr.String()) |
| 129 | return &CancellableCmd{cmd, cmdCancel}, nil |
| 130 | } |
| 131 | |
| 132 | func CpWshToRemote(ctx context.Context, client *wsl.Distro, clientOs string, clientArch string) error { |
| 133 | wshLocalPath, err := shellutil.GetLocalWshBinaryPath(wavebase.WaveVersion, clientOs, clientArch) |
no test coverage detected