Skip to content

Commit a033729

Browse files
committed
sample(34-grpc-client-server): skip a (proto) folder
1 parent f99c6b3 commit a033729

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

tools/gulp/tasks/samples.ts

+10-1
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@ import * as childProcess from 'child_process';
22
import * as clc from 'cli-color';
33
import * as log from 'fancy-log';
44
import { task } from 'gulp';
5-
import { resolve } from 'path';
5+
import { join, resolve } from 'path';
66
import { promisify } from 'util';
77
import { samplePath } from '../config';
88
import { containsPackageJson, getDirs } from '../util/task-helpers';
9+
import { existsSync } from 'fs';
910

1011
const exec = promisify(childProcess.exec);
1112

@@ -43,6 +44,14 @@ async function executeNPMScriptInDirectory(
4344
appendScript?: string,
4445
) {
4546
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+
4655
log.info(`Running ${clc.blue(script)} in ${clc.magenta(dirName)}`);
4756
try {
4857
const result = await exec(

0 commit comments

Comments
 (0)