Skip to content

Commit

Permalink
sample(34-grpc-client-server): skip a (proto) folder
Browse files Browse the repository at this point in the history
  • Loading branch information
youngkiu committed Mar 18, 2024
1 parent 989ba09 commit 1d50eea
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tools/gulp/tasks/samples.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ import * as childProcess from 'child_process';
import * as clc from 'cli-color';
import * as log from 'fancy-log';
import { task } from 'gulp';
import { resolve } from 'path';
import { join, resolve } from 'path';
import { promisify } from 'util';
import { samplePath } from '../config';
import { containsPackageJson, getDirs } from '../util/task-helpers';
import { existsSync } from 'fs';

const exec = promisify(childProcess.exec);

Expand Down Expand Up @@ -43,6 +44,14 @@ async function executeNPMScriptInDirectory(
appendScript?: string,
) {
const dirName = dir.replace(resolve(__dirname, '../../../'), '');

if (!existsSync(join(dir, 'package.json'))) {
log.info(
`Skipping ${clc.magenta(dirName)} as it does not contain a package.json`,
);
return;
}

log.info(`Running ${clc.blue(script)} in ${clc.magenta(dirName)}`);
try {
const result = await exec(
Expand Down

0 comments on commit 1d50eea

Please sign in to comment.