Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

Commit

Permalink
chore: Fix CSS dependency test to accept new Sass style pattern (#6152)
Browse files Browse the repository at this point in the history
  • Loading branch information
abhiomkar authored Jun 26, 2020
1 parent feae5d7 commit 39983fa
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions scripts/check-pkg-for-release.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,16 +188,14 @@ function checkPkgDependencyAddedInMDCPackage() {

function checkCSSDependencyAddedInMDCPackage() {
const name = getPkgName();
const nameMDC = `mdc-${name}`;
if (CSS_EXCLUDES.has(name)) {
return;
}

const src = fs.readFileSync(path.join(process.env.PWD, MASTER_CSS_RELATIVE_PATH), 'utf8');
const cssRules = src.match(/@material[a-z-\/]+/g);
const cssRule = path.join(CLI_PACKAGE_JSON.name, nameMDC);

assert.notEqual(cssRules.indexOf(cssRule), -1,
const shouldImportCSS = !!src.match(`${CLI_PACKAGE_JSON.name}/`);
assert(shouldImportCSS,
'FAILURE: Component ' + CLI_PACKAGE_JSON.name + ' is not being imported in MDC Web. ' +
'Please add ' + name + ' to ' + MASTER_CSS_RELATIVE_PATH + ' import rule before commit.');
}
Expand Down

0 comments on commit 39983fa

Please sign in to comment.