File tree 1 file changed +10
-1
lines changed
1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -2,10 +2,11 @@ import * as childProcess from 'child_process';
2
2
import * as clc from 'cli-color' ;
3
3
import * as log from 'fancy-log' ;
4
4
import { task } from 'gulp' ;
5
- import { resolve } from 'path' ;
5
+ import { join , resolve } from 'path' ;
6
6
import { promisify } from 'util' ;
7
7
import { samplePath } from '../config' ;
8
8
import { containsPackageJson , getDirs } from '../util/task-helpers' ;
9
+ import { existsSync } from 'fs' ;
9
10
10
11
const exec = promisify ( childProcess . exec ) ;
11
12
@@ -43,6 +44,14 @@ async function executeNPMScriptInDirectory(
43
44
appendScript ?: string ,
44
45
) {
45
46
const dirName = dir . replace ( resolve ( __dirname , '../../../' ) , '' ) ;
47
+
48
+ if ( ! existsSync ( join ( dir , 'package.json' ) ) ) {
49
+ log . info (
50
+ `Skipping ${ clc . magenta ( dirName ) } as it does not contain a package.json` ,
51
+ ) ;
52
+ return ;
53
+ }
54
+
46
55
log . info ( `Running ${ clc . blue ( script ) } in ${ clc . magenta ( dirName ) } ` ) ;
47
56
try {
48
57
const result = await exec (
You can’t perform that action at this time.
0 commit comments