(raw string, legacyTimeoutField bool)
| 1666 | |
| 1667 | func projectRuntimeDirFromContext(execCtx ExecutionContext, cwd string) string { |
| 1668 | if execCtx != nil { |
| 1669 | if runtimeDir, ok := execCtx["runtime_dir"].(string); ok && strings.TrimSpace(runtimeDir) != "" { |
| 1670 | return runtimeDir |
| 1671 | } |
| 1672 | } |
| 1673 | return config.ProjectRuntimeDir(cwd) |
| 1674 | } |
| 1675 | |
| 1676 | func toolResultsDirFromContext(execCtx ExecutionContext, cwd string) string { |
| 1677 | if execCtx != nil { |
| 1678 | if cfg, ok := execCtx["config"].(config.Config); ok { |
| 1679 | sessionID, _ := execCtx["_session_id"].(string) |
| 1680 | sessionID = strings.TrimSpace(sessionID) |
| 1681 | if resultDir := cfg.ToolResultsDir(sessionID); resultDir != "" { |
| 1682 | return resultDir |
| 1683 | } |
| 1684 | } |
| 1685 | } |
| 1686 | return filepath.Join(projectRuntimeDirFromContext(execCtx, cwd), "tool-results", "_legacy") |
| 1687 | } |
| 1688 | |
| 1689 | func bashYoloEnabled(execCtx ExecutionContext) bool { |
| 1690 | if execCtx != nil { |
| 1691 | if state, ok := execCtx["parent_state"].(interface{ YoloEnabled() bool }); ok && state.YoloEnabled() { |
| 1692 | return true |
| 1693 | } |
| 1694 | if cfg, ok := execCtx["config"].(config.Config); ok && cfg.Yolo { |
| 1695 | return true |
| 1696 | } |
| 1697 | } |
| 1698 | return false |
| 1699 | } |
| 1700 | |
| 1701 | func runShellCommand(ctx context.Context, command, cwd string, timeout time.Duration) (int, string) { |
| 1702 | return runArgvCommand(ctx, bashpkg.ShellArgv(command, ""), cwd, timeout, command) |
no test coverage detected