Skip to content

Commit

Permalink
Add fs and path dependencies, copy index file to docs folder
Browse files Browse the repository at this point in the history
  • Loading branch information
hoangsvit committed Jan 31, 2024
1 parent 241d32d commit c3af81b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
7 changes: 6 additions & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion src/helper/markdown/output_markdown.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const fs = require('fs-extra');
const path = require('path');
const markdownFile = require('../../helper/file/markdown_file');
let outputMarkdown = (function () {
let setCountryName = function (country) {
Expand All @@ -19,7 +21,10 @@ let outputMarkdown = (function () {
return `docs/followers/${fileName}.md`;
}
let saveIndexMarkdownFile = async function (markdown) {
await markdownFile.outputMarkdownFile(setIndexPath(), markdown);
let indexPath = setIndexPath();
await markdownFile.outputMarkdownFile(indexPath, markdown);
let docsPath = path.join('docs', indexPath);
await fs.copy(indexPath, docsPath);
}
let savePublicContributionsMarkdownFile = async function (country, markdown) {
await markdownFile.outputMarkdownFile(setPublicContributionsPath(country), markdown);
Expand Down

0 comments on commit c3af81b

Please sign in to comment.