Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add ignore file support
  • Loading branch information
Fogolan committed Oct 2, 2018
commit 19c512ca05e857b3b9de62dfa7da28a2a9a9efdd
3 changes: 2 additions & 1 deletion tools/office-cmdlet-updater/config/default.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"platyPS": {
"docPath": "..\\..\\teams\\teams-ps\\teams"
"docPath": "..\\..\\teams\\teams-ps\\teams",
"ignoreFiles": []
},
"sendgrid": {
"sendMailNotification": false,
Expand Down
13 changes: 11 additions & 2 deletions tools/office-cmdlet-updater/services/markdown.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,18 @@ class MarkdownService {

async addMdFilesInQueue(folderPath) {
const mdExt = '.md';
const { ignoreFiles } = this.config.get('platyPS');
const ignoreAbsolutePathsArr = ignoreFiles.map((f) => path.resolve(f));

const allFiles = await fs.readdir(folderPath);
const mdFiles = allFiles.filter((fileName) => fileName.endsWith(mdExt));
const isFileIgnore = (fileName) => {
const absoluteFilePath = path.resolve(fileName);

return ignoreAbsolutePathsArr.includes(absoluteFilePath);
};

const mdFiles = (await fs.readdir(folderPath))
.map((f) => path.resolve(folderPath, f))
.filter((fn) => fn.endsWith(mdExt) && !isFileIgnore(fn));

mdFiles.forEach((fileName) => {
const absolutePath = path.resolve(`${folderPath}\\${fileName}`);
Expand Down