-
Notifications
You must be signed in to change notification settings - Fork 111
helper.js: GetFolders -> GetModules, add package.json existence check #697
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -145,17 +145,21 @@ const GetDepTree = ( name ) => { | |||||
|
|
||||||
|
|
||||||
| /** | ||||||
| * Get all folders within a given path | ||||||
| * Get all modules within a given path. | ||||||
| * Module is folder with package.json | ||||||
This conversation was marked as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
| * | ||||||
| * @param {string} thisPath - The path that contains the desired folders | ||||||
| * @param {boolean} verbose - Verbose flag either undefined or true | ||||||
| * | ||||||
| * @return {array} - An array of names of each folder | ||||||
| */ | ||||||
| const GetFolders = ( thisPath, verbose ) => { | ||||||
| const GetModules = ( thisPath, verbose ) => { | ||||||
| try { | ||||||
| let folders = Fs.readdirSync( thisPath ).filter( | ||||||
| thisFile => Fs.statSync(`${ thisPath }/${ thisFile }`).isDirectory() | ||||||
| thisFile => { | ||||||
| let path = `${ thisPath }/${ thisFile }`; | ||||||
This conversation was marked as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
| return Fs.statSync(path).isDirectory() && Fs.existsSync(`${path}/package.json`) | ||||||
|
||||||
| return Fs.statSync(path).isDirectory() && Fs.existsSync(`${path}/package.json`) | |
| return Fs.statSync( path ).isDirectory() && Fs.existsSync( `${path}/package.json` ) |
We might need to put a Path.normalize( ${path}/package.json ) here also
Uh oh!
There was an error while loading. Please reload this page.