(ctx context.Context, targetRepo string)
| 181 | } |
| 182 | |
| 183 | func prepareDeployCheckout(ctx context.Context, targetRepo string) (string, string, error) { |
| 184 | gitRoot, err := gitutil.FindGitRoot() |
| 185 | if err != nil { |
| 186 | return "", "", fmt.Errorf("deploy command requires running inside a git repository: %w", err) |
| 187 | } |
| 188 | |
| 189 | updatesDir, err := ensureUpdateTargetRepoGitignore(gitRoot) |
| 190 | if err != nil { |
| 191 | return "", "", err |
| 192 | } |
| 193 | |
| 194 | checkoutDir := filepath.Join(updatesDir, sanitizeRepoPath(targetRepo)) |
| 195 | if err := shallowCloneTargetRepo(ctx, targetRepo, checkoutDir); err != nil { |
| 196 | return "", "", err |
| 197 | } |
| 198 | |
| 199 | originalDir, err := os.Getwd() |
| 200 | if err != nil { |
| 201 | return "", "", fmt.Errorf("failed to read current directory: %w", err) |
| 202 | } |
| 203 | |
| 204 | return checkoutDir, originalDir, nil |
| 205 | } |
| 206 | |
| 207 | func runDeployUpdatePass(ctx context.Context, addOpts AddOptions, coolDown time.Duration) error { |
| 208 | if err := PreflightCheckForCreatePR(addOpts.Verbose); err != nil { |
no test coverage detected