Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions internal/cli/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -538,18 +538,13 @@ func runAgent(agentName, fullsendDir, outputBase, targetRepo, fullsendBinary str

// 9d. Extract target repo back to host. SafeDownload removes symlinks
// and .git/hooks/ after download to prevent sandbox escape.
if iteration > 1 {
if clearErr := os.RemoveAll(repoSrc); clearErr != nil {
printer.StepWarn(fmt.Sprintf("Failed to clear local repo %s: %s", repoSrc, clearErr.Error()))
}
if clearErr := os.RemoveAll(repoSrc); clearErr != nil {
printer.StepWarn(fmt.Sprintf("Failed to clear local repo %s: %s", repoSrc, clearErr.Error()))
}
repoExtractStart := time.Now()
printer.StepStart("Extracting target repo")
if err := sandbox.SafeDownload(sandboxName, repoDir, repoSrc); err != nil {
if iteration > 1 {
return fmt.Errorf("re-extracting target repo (iteration %d): %w", iteration, err)
}
printer.StepWarn("Failed to extract target repo: " + err.Error())
return fmt.Errorf("extracting target repo (iteration %d): %w", iteration, err)
} else {
printer.StepDone(fmt.Sprintf("Target repo extracted to %s (%.1fs)", repoSrc, time.Since(repoExtractStart).Seconds()))
}
Expand Down
Loading