This repository was archived by the owner on May 16, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed
packages/atlauncher-scripts Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change 1+ const chalk = require ( 'chalk' ) ;
12const utils = require ( '../utils' ) ;
23
34const args = process . argv . slice ( 2 ) ;
@@ -17,6 +18,11 @@ if (args.length) {
1718}
1819
1920if ( watch ) {
21+ if ( utils . wasRunInLernaRoot ( ) ) {
22+ console . log ( chalk . white . bgRed ( 'Cannot run watch within a lerna root' ) ) ;
23+ process . exit ( 1 ) ;
24+ }
25+
2026 const processArguments = [ utils . getProjectPath ( 'src/**/*.js' ) , '--initial' , '-c npm run lint:js' ] ;
2127
2228 utils . spawnSyncProcess ( utils . getNodeModulesBinPath ( 'chokidar' ) , processArguments ) ;
@@ -36,4 +42,4 @@ const processArguments = [
3642 debug && '--debug' ,
3743] . concat ( utils . getProjectPaths ( '**/*.js' ) ) ;
3844
39- utils . spawnSyncProcess ( utils . getNodeModulesBinPath ( 'eslint' ) , processArgumentsS ) ;
45+ utils . spawnSyncProcess ( utils . getNodeModulesBinPath ( 'eslint' ) , processArguments ) ;
Original file line number Diff line number Diff line change @@ -21,6 +21,15 @@ function getLernaPackagePaths() {
2121 return packages ;
2222}
2323
24+ /**
25+ * Determines if atlauncher-scripts was run from a lerna root.
26+ *
27+ * @returns {boolean }
28+ */
29+ function wasRunInLernaRoot ( ) {
30+ return getLernaPackagePaths ( ) . length ;
31+ }
32+
2433/**
2534 * This ensures that the given path always ends with a / (or not);
2635 *
@@ -275,6 +284,7 @@ module.exports = {
275284 getProjectPath,
276285 getProjectPaths,
277286 spawnSyncProcess,
287+ wasRunInLernaRoot,
278288 getNodeModulesPath,
279289 getNodeModulesBinPath,
280290 getConfigFromPackageJson,
You can’t perform that action at this time.
0 commit comments