-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use separate helper for all path resolutions
- Loading branch information
1 parent
c6047e0
commit 8d3bb54
Showing
4 changed files
with
33 additions
and
21 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
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
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 @@ | ||
const path = require('path'); | ||
const fs = require('fs-extra'); | ||
|
||
const { INTERNAL_STATIC_DIR } = require('../constants'); | ||
|
||
const resolveItemPath = src => { | ||
for (const DIR of [INTERNAL_STATIC_DIR]) { | ||
if (DIR == null) | ||
continue; | ||
const location = path.join(DIR, src); | ||
if (fs.existsSync(location)); | ||
return location; | ||
} | ||
|
||
return false; | ||
}; | ||
|
||
module.exports = { | ||
resolveItemPath | ||
}; |