Skip to content

Commit b31b658

Browse files
Spencerspalger
andauthored
[dev/cli] ensure plugins/ and all watch source dirs exist (#78973)
Co-authored-by: spalger <spalger@users.noreply.github.com>
1 parent 1899532 commit b31b658

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

plugins/.empty

Whitespace-only changes.

src/cli/cluster/cluster_manager.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
import { resolve } from 'path';
2121
import { format as formatUrl } from 'url';
22+
import Fs from 'fs';
2223

2324
import opn from 'opn';
2425
import { REPO_ROOT } from '@kbn/utils';
@@ -233,6 +234,14 @@ export class ClusterManager {
233234
)
234235
);
235236

237+
for (const watchPath of watchPaths) {
238+
if (!Fs.existsSync(fromRoot(watchPath))) {
239+
throw new Error(
240+
`A watch directory [${watchPath}] does not exist, which will cause chokidar to fail. Either make sure the directory exists or remove it as a watch source in the ClusterManger`
241+
);
242+
}
243+
}
244+
236245
const ignorePaths = [
237246
/[\\\/](\..*|node_modules|bower_components|target|public|__[a-z0-9_]+__|coverage)([\\\/]|$)/,
238247
/\.test\.(js|tsx?)$/,

0 commit comments

Comments
 (0)