Skip to content

Commit

Permalink
fix: globifyGitIgnoreFile
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Mar 3, 2021
1 parent 170bf68 commit 2d76bf3
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/path-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@ export function posixifyPathNormalized(givenPath) {
return posixifyPath(givenPath).replace(/[/\\]$/, "")
}

/**
* Parse and globy the `.gitingore` file that exists in a directry
* @param {string} gitIgnoreDirectory The given directory that has the `.gitignore` file
* @returns {Promise<Array<string>>} an array of glob patterns
*/
export async function globifyGitIgnoreFile(gitIgnoreDirectory) {
return globifyGitIgnore(await readFile(path.join(gitIgnoreDirectory, ".gitignore"), "utf-8"), gitIgnoreDirectory)
}

/**
* Read `.gitingore` file from a directry
* @param {string} gitIgnoreContent the content of the gitignore file
Expand Down

0 comments on commit 2d76bf3

Please sign in to comment.