RunInteractiveGitCommand executes a git command in the specified directory in interactive mode.
(ctx context.Context, dir string, w io.Writer, args ...string)
| 54 | |
| 55 | // RunInteractiveGitCommand executes a git command in the specified directory in interactive mode. |
| 56 | func RunInteractiveGitCommand(ctx context.Context, dir string, w io.Writer, args ...string) (rerr error) { |
| 57 | slog.Info(fmt.Sprintf("[%s] $ git %s", dir, strings.Join(args, " "))) |
| 58 | defer func() { |
| 59 | slog.Info(fmt.Sprintf("[%s] $ git %s (DONE)", dir, strings.Join(args, " ")), "err", rerr) |
| 60 | }() |
| 61 | |
| 62 | cmd := exec.CommandContext(ctx, "git", args...) |
| 63 | cmd.Dir = dir |
| 64 | cmd.Stdout = w |
| 65 | cmd.Stderr = w |
| 66 | |
| 67 | return cmd.Run() |
| 68 | } |
| 69 | |
| 70 | func getContainerUseRemote(ctx context.Context, repo string) (string, error) { |
| 71 | // Check if we already have a container-use remote |