Skip to content

Commit

Permalink
Skip updating samples if samples-dev is not present (#17454)
Browse files Browse the repository at this point in the history
  • Loading branch information
praveenkuttappan authored Sep 3, 2021
1 parent 1e0d4b5 commit 8a7f4e2
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions eng/tools/eng-package-utils/update-samples.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const path = require("path");
const process = require("process");
const { spawnSync } = require("child_process");
const { getRushSpec } = require("./index");
const fs = require("fs");


const parseArgs = () => {
Expand Down Expand Up @@ -34,12 +35,18 @@ async function main(repoRoot, artifactName) {
);

if (!targetPackage) {
console.error(`Package is not found in rush.json for artifact ${artifactName}`);
console.log(`Package is not found in rush.json for artifact ${artifactName}`);
return;
}

if (targetPackage.versionPolicyName == "management") {
console.error(`Skipping update samples for management package ${artifactName}`);
console.log(`Skipping update samples for management package ${artifactName}`);
return;
}

const samplesDevPath = path.join(targetPackage.projectFolder, "samples-dev");
if (!fs.existsSync(samplesDevPath)) {
console.log(`Samples-dev directory is not present in ${targetPackage.projectFolder}. Skipping udpate samples.`);
return;
}

Expand Down

0 comments on commit 8a7f4e2

Please sign in to comment.