Skip to content

Commit

Permalink
chore(npm): fix serve-and-sync command (#5283)
Browse files Browse the repository at this point in the history
* chore(npm): fix `serve-and-sync` command

* chore(npm): fix `serve-and-sync` command
  • Loading branch information
dzhavat authored and benlesh committed Apr 3, 2020
1 parent d84af57 commit f39eb29
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions docs_app/tools/transforms/authors-package/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@
/* eslint no-console: "off" */

function createPackage(changedFile) {
const marketingMatch = /^aio\/content\/marketing\/(.*)/.exec(changedFile);
const marketingMatch = /^docs_app\/content\/marketing\/(.*)/.exec(changedFile);
if (marketingMatch) {
console.log('Building marketing docs');
return require('./marketing-package').createPackage();
}

const tutorialMatch = /^aio\/content\/tutorial\/([^.]+)\.md/.exec(changedFile);
const tutorialExampleMatch = /^aio\/content\/examples\/(toh-[^\/]+)\//.exec(changedFile);
const tutorialMatch = /^docs_app\/content\/tutorial\/([^.]+)\.md/.exec(changedFile);
const tutorialExampleMatch = /^docs_app\/content\/examples\/(toh-[^\/]+)\//.exec(changedFile);
if (tutorialMatch || tutorialExampleMatch) {
const tutorialName = tutorialMatch && tutorialMatch[1] || tutorialExampleMatch[1];
console.log('Building tutorial docs');
return require('./tutorial-package').createPackage(tutorialName);
}

const guideMatch = /^aio\/content\/guide\/([^.]+)\.md/.exec(changedFile);
const exampleMatch = /^aio\/content\/examples\/(?:cb-)?([^\/]+)\//.exec(changedFile);
const guideMatch = /^docs_app\/content\/guide\/([^.]+)\.md/.exec(changedFile);
const exampleMatch = /^docs_app\/content\/examples\/(?:cb-)?([^\/]+)\//.exec(changedFile);
if (guideMatch || exampleMatch) {
const guideName = guideMatch && guideMatch[1] || exampleMatch[1];
console.log(`Building guide doc: ${guideName}.md`);
Expand Down

0 comments on commit f39eb29

Please sign in to comment.