-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(fs.service.js):
fs.service
was added to manage file-system inde…
…xing more efficient `fs.service` was added to manage file-system indexing more efficient. It also fixes "twice-event-report" problem caused by `git` command (#21). This service (that is a singleton) can cache the result of requests and so improves the performance. It exposes an extra layer on top of `readDirectory` that consumers (`buildConfig.js`, `refresh.js`, and `watch.js` for now) should use (instead of direct access to `readDirectory`). fix #21
- Loading branch information
1 parent
d309f32
commit f559e76
Showing
3 changed files
with
47 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import readDirectory from './readDirectory'; | ||
import findRootDirectory from './findRootDirectory'; | ||
|
||
// noinspection JSUnusedGlobalSymbols | ||
export default (() => { | ||
let kojiConfigFiles; | ||
|
||
function refresh() { | ||
kojiConfigFiles = readDirectory(findRootDirectory()) | ||
.filter((path) => (path.endsWith('koji.json') || path.includes('.koji')) && !path.includes('.koji-resources')); | ||
} | ||
|
||
refresh(); | ||
|
||
// noinspection JSUnusedAssignment, JSUnusedGlobalSymbols | ||
return { | ||
kojiConfigFiles, | ||
refresh, | ||
}; | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters