mirror of
https://github.com/JuanCanham/HackMyResume.git
synced 2024-11-22 08:20:11 +00:00
Replace file-exists.js with NPM path-exists.
This commit is contained in:
parent
dab6ebfd82
commit
ebad1677bc
@ -48,6 +48,7 @@
|
||||
"minimist": "^1.2.0",
|
||||
"mkdirp": "^0.5.1",
|
||||
"moment": "^2.10.6",
|
||||
"path-exists": "^2.1.0",
|
||||
"recursive-readdir-sync": "^1.0.6",
|
||||
"simple-html-tokenizer": "^0.2.0",
|
||||
"underscore": "^1.8.3",
|
||||
|
@ -224,7 +224,7 @@ Definition of the TemplateGenerator class.
|
||||
PATH.parse( require.resolve('fluent-themes') ).dir,
|
||||
this.opts.theme
|
||||
);
|
||||
var exists = require('../utils/file-exists');
|
||||
var exists = require('path-exists').sync;
|
||||
if( !exists( tFolder ) ) {
|
||||
tFolder = PATH.resolve( this.opts.theme );
|
||||
if( !exists( tFolder ) ) {
|
||||
|
@ -1,19 +0,0 @@
|
||||
/**
|
||||
Definition of the `fileExists` method.
|
||||
@license MIT. Copyright (c) 2015 James Devlin / FluentDesk.
|
||||
@module file-exists.js
|
||||
*/
|
||||
|
||||
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');
|
||||
}
|
||||
};
|
@ -51,7 +51,7 @@
|
||||
// Verify the specified theme name/path
|
||||
var relativeThemeFolder = '../../node_modules/fluent-themes/themes';
|
||||
var tFolder = PATH.resolve( __dirname, relativeThemeFolder, _opts.theme);
|
||||
var exists = require('../utils/file-exists');
|
||||
var exists = require('path-exists').sync;
|
||||
if (!exists( tFolder )) {
|
||||
tFolder = PATH.resolve( _opts.theme );
|
||||
if (!exists( tFolder )) {
|
||||
|
Loading…
Reference in New Issue
Block a user