({
spinner,
pipesDir
}: {
spinner: Spinner;
pipesDir: string;
})
| 114 | } |
| 115 | |
| 116 | async function readPipesDirectory({ |
| 117 | spinner, |
| 118 | pipesDir |
| 119 | }: { |
| 120 | spinner: Spinner; |
| 121 | pipesDir: string; |
| 122 | }): Promise<string[] | null> { |
| 123 | spinner.start('Reading pipes directory'); |
| 124 | try { |
| 125 | const files = await fs.readdir(pipesDir); |
| 126 | // Filter out non-json files |
| 127 | const pipes = files.filter(file => path.extname(file) === '.json'); |
| 128 | |
| 129 | spinner.stop( |
| 130 | `Found ${pipes.length} pipe${pipes.length !== 1 ? 's' : ''}` |
| 131 | ); |
| 132 | return pipes; |
| 133 | } catch (error) { |
| 134 | handleDirectoryReadError({ spinner, dir: pipesDir, error }); |
| 135 | return null; |
| 136 | } |
| 137 | } |
| 138 | |
| 139 | async function readToolsDirectory({ |
| 140 | spinner, |
no test coverage detected