Skip to content
This repository has been archived by the owner on Aug 26, 2021. It is now read-only.

Commit

Permalink
Added FileExists functions to helper.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam A. Zerella committed Feb 18, 2019
1 parent 226a048 commit 71116d3
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions scripts/generate-readme/src/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ const IsDirectory = ( source ) => {
return Fs.lstatSync( source ).isDirectory();
}


/**
* GetFolder - Gets all the folders inside a location
*
Expand All @@ -26,4 +25,22 @@ const GetFolders = async ( folderLocation ) => {
}


module.exports.GetFolders = GetFolders;
/**
* Return true if a component folder location has a `jquery.js` file.
*
* @param {string} folderLocation - Component folder location.
*/
const FileExists = async ( fileLocation ) => {
try {
return ( await Fsp.stat( fileLocation ) ).isFile()
}
catch( error ) {
console.error( error );
}
return false;
}



module.exports.GetFolders = GetFolders;
module.exports.FileExists = FileExists;

0 comments on commit 71116d3

Please sign in to comment.