Skip to content

Commit

Permalink
fix: get directoryPath as the input of _populateCacheFor
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Mar 3, 2021
1 parent bd18ce4 commit 38a9120
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/paths-cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,9 @@ export default class PathsCache extends EventEmitter {
*/
async _buildInitialCacheWithGlob() {
await this._cacheProjectPathsAndRepositories()
const result = await Promise.all(this._projectDirectories.map((d) => this._populateCacheFor(d)))
const result = await Promise.all(
this._projectDirectories.map((projectDirectory) => this._populateCacheFor(projectDirectory.path))
)

this.emit("rebuild-cache-done")
return result
Expand Down Expand Up @@ -396,14 +398,12 @@ export default class PathsCache extends EventEmitter {
}

/**
* Populates cache for a project directory
* @param {Directory} projectDirectory
* @return {Promise}
* Populates cache for the given directory
* @param {string} directoryPath the given directory path
* @return {Promise<Array<string>>}
* @private
*/
async _populateCacheFor(projectDirectory) {
const directoryPath = projectDirectory.path

async _populateCacheFor(directoryPath) {
const directoryGlob = globifyDirectory(directoryPath)
const gitignoreGlob = await this._getGitIgnoreGlob(directoryPath)
const ignoredPatternsGlob = this._getIgnoredPatternsGlob(directoryPath)
Expand Down

0 comments on commit 38a9120

Please sign in to comment.