(dir: string, input?: { createDir?: boolean; remove?: (info: WorkspaceInfo) => Promise<void> })
| 218 | } |
| 219 | |
| 220 | function localAdapter(dir: string, input?: { createDir?: boolean; remove?: (info: WorkspaceInfo) => Promise<void> }) { |
| 221 | return recordedAdapter({ |
| 222 | configure(info) { |
| 223 | return { ...info, directory: dir } |
| 224 | }, |
| 225 | async create() { |
| 226 | if (input?.createDir === false) return |
| 227 | await fs.mkdir(dir, { recursive: true }) |
| 228 | }, |
| 229 | remove: input?.remove, |
| 230 | target() { |
| 231 | return { type: "local", directory: dir } |
| 232 | }, |
| 233 | }) |
| 234 | } |
| 235 | |
| 236 | function remoteAdapter(url: string, input?: { directory?: string | null; headers?: HeadersInit }) { |
| 237 | return recordedAdapter({ |
no test coverage detected