(session: SessionState, actions: SessionAction[])
| 154 | } |
| 155 | |
| 156 | function formatScript(session: SessionState, actions: SessionAction[]): string { |
| 157 | const lines: string[] = []; |
| 158 | const kind = session.device.kind ? ` kind=${session.device.kind}` : ''; |
| 159 | const theme = 'unknown'; |
| 160 | lines.push( |
| 161 | // approach (b): emit the PUBLIC leaf platform (ios/macos), never the internal `apple`. |
| 162 | `context platform=${publicPlatformString(session.device)} device=${formatScriptStringLiteral(session.device.name)}${kind} theme=${theme}`, |
| 163 | ); |
| 164 | for (const action of actions) { |
| 165 | if (action.flags?.noRecord) continue; |
| 166 | lines.push(formatActionLine(action)); |
| 167 | } |
| 168 | return `${lines.join('\n')}\n`; |
| 169 | } |
| 170 | |
| 171 | function formatActionLine(action: SessionAction): string { |
| 172 | const parts: string[] = [action.command]; |
no test coverage detected