[dev/cli] ensure plugins/ and all watch source dirs exist (#78973)

Co-authored-by: spalger <spalger@users.noreply.github.com>
This commit is contained in:
Spencer 2020-09-30 10:20:44 -07:00 committed by GitHub
parent 189953299b
commit b31b658274
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

0
plugins/.empty Normal file
View file

View file

@ -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';
@ -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?)$/,