Skip to content

Commit

Permalink
[7.x] [dev/cli] ensure plugins/ and all watch source dirs exist (#78973
Browse files Browse the repository at this point in the history
…) (#78998)

Co-authored-by: spalger <[email protected]>

Co-authored-by: spalger <[email protected]>
  • Loading branch information
Spencer and spalger authored Sep 30, 2020
1 parent ba9a18b commit 7d55428
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Empty file added plugins/.empty
Empty file.
9 changes: 9 additions & 0 deletions src/cli/cluster/cluster_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import { resolve } from 'path';
import { format as formatUrl } from 'url';
import Fs from 'fs';

import opn from 'opn';
import { REPO_ROOT } from '@kbn/utils';
Expand Down Expand Up @@ -233,6 +234,14 @@ export class ClusterManager {
)
);

for (const watchPath of watchPaths) {
if (!Fs.existsSync(fromRoot(watchPath))) {
throw new Error(
`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`
);
}
}

const ignorePaths = [
/[\\\/](\..*|node_modules|bower_components|target|public|__[a-z0-9_]+__|coverage)([\\\/]|$)/,
/\.test\.(js|tsx?)$/,
Expand Down

0 comments on commit 7d55428

Please sign in to comment.