mirror of
https://github.com/JuanCanham/HackMyResume.git
synced 2025-05-10 07:47:07 +01:00
Multiple things.
1. Load themes directly in FCMD instead of only through FluentLib. 2. Add support for silent mode (`-s` or `--silent`). 3. Silently create output folder if not present (mkdirp).
This commit is contained in:
18
src/utils/file-exists.js
Normal file
18
src/utils/file-exists.js
Normal file
@ -0,0 +1,18 @@
|
||||
/**
|
||||
File-exists checker for Node.js.
|
||||
@license Copyright (c) 2015 | James M. Devlin
|
||||
*/
|
||||
|
||||
var FS = require('fs');
|
||||
|
||||
// Yup, this is now the recommended way to check for file existence on Node.
|
||||
// fs.exists is deprecated and the recommended fs.statSync/lstatSync throws
|
||||
// exceptions on non-existent paths :)
|
||||
module.exports = function (path) {
|
||||
try {
|
||||
FS.statSync( path );
|
||||
return true;
|
||||
} catch( err ) {
|
||||
return !(err && err.code === 'ENOENT');
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user