Skip to content

Commit

Permalink
Creating the directory if it does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
diemol committed Jan 15, 2024
1 parent 800a6ca commit 1522fef
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,13 @@ async function main() {
// If a .github directory exists in tmpGitHubRepoDir, copy all *.md files from it to the directory being analyzed
const githubDir = path.join(tmpGitHubRepoDir, '.github')
const githubDestDir = path.join(tmpDir, '.github')
if (fs.existsSync(githubDir) && fs.existsSync(githubDestDir)) {

// Create the .github directory if it doesn't exist
if (!fs.existsSync(githubDestDir)) {
fs.mkdirSync(githubDestDir)
}

if (fs.existsSync(githubDir)) {
const githubFiles = await fs.promises.readdir(githubDir)
githubFiles
.filter(githubFile => githubFile.toLowerCase().endsWith('.md'))
Expand Down

0 comments on commit 1522fef

Please # to comment.