(path: string, recreate: boolean)
| 114 | } |
| 115 | |
| 116 | export async function prepareDirPath(path: string, recreate: boolean): Promise<void> { |
| 117 | try { |
| 118 | await rimraf(path); |
| 119 | if (recreate) { |
| 120 | await fs.promises.mkdir(path, {recursive: true}); |
| 121 | } |
| 122 | } catch (e: any) { |
| 123 | throw new Error(`Failed to prepare ${path}: ${e.message}`); |
| 124 | } |
| 125 | } |
| 126 | |
| 127 | // oclif's default path resolver only applies when parsed as `--flag path` |
| 128 | // else it would not resolve, hence we need to resolve it manually. |
no outgoing calls
no test coverage detected