nav tabs on admin dashboard
This commit is contained in:
11
node_modules/fs-extra/lib/ensure/file.js
generated
vendored
11
node_modules/fs-extra/lib/ensure/file.js
generated
vendored
@@ -14,9 +14,8 @@ function createFile (file, callback) {
|
||||
})
|
||||
}
|
||||
|
||||
pathExists(file, (err, fileExists) => {
|
||||
if (err) return callback(err)
|
||||
if (fileExists) return callback()
|
||||
fs.stat(file, (err, stats) => { // eslint-disable-line handle-callback-err
|
||||
if (!err && stats.isFile()) return callback()
|
||||
const dir = path.dirname(file)
|
||||
pathExists(dir, (err, dirExists) => {
|
||||
if (err) return callback(err)
|
||||
@@ -30,7 +29,11 @@ function createFile (file, callback) {
|
||||
}
|
||||
|
||||
function createFileSync (file) {
|
||||
if (fs.existsSync(file)) return
|
||||
let stats
|
||||
try {
|
||||
stats = fs.statSync(file)
|
||||
} catch (e) {}
|
||||
if (stats && stats.isFile()) return
|
||||
|
||||
const dir = path.dirname(file)
|
||||
if (!fs.existsSync(dir)) {
|
||||
|
||||
4
node_modules/fs-extra/lib/ensure/link.js
generated
vendored
4
node_modules/fs-extra/lib/ensure/link.js
generated
vendored
@@ -17,7 +17,7 @@ function createLink (srcpath, dstpath, callback) {
|
||||
pathExists(dstpath, (err, destinationExists) => {
|
||||
if (err) return callback(err)
|
||||
if (destinationExists) return callback(null)
|
||||
fs.lstat(srcpath, (err, stat) => {
|
||||
fs.lstat(srcpath, (err) => {
|
||||
if (err) {
|
||||
err.message = err.message.replace('lstat', 'ensureLink')
|
||||
return callback(err)
|
||||
@@ -36,7 +36,7 @@ function createLink (srcpath, dstpath, callback) {
|
||||
})
|
||||
}
|
||||
|
||||
function createLinkSync (srcpath, dstpath, callback) {
|
||||
function createLinkSync (srcpath, dstpath) {
|
||||
const destinationExists = fs.existsSync(dstpath)
|
||||
if (destinationExists) return undefined
|
||||
|
||||
|
||||
4
node_modules/fs-extra/lib/ensure/symlink-paths.js
generated
vendored
4
node_modules/fs-extra/lib/ensure/symlink-paths.js
generated
vendored
@@ -28,7 +28,7 @@ const pathExists = require('../path-exists').pathExists
|
||||
|
||||
function symlinkPaths (srcpath, dstpath, callback) {
|
||||
if (path.isAbsolute(srcpath)) {
|
||||
return fs.lstat(srcpath, (err, stat) => {
|
||||
return fs.lstat(srcpath, (err) => {
|
||||
if (err) {
|
||||
err.message = err.message.replace('lstat', 'ensureSymlink')
|
||||
return callback(err)
|
||||
@@ -49,7 +49,7 @@ function symlinkPaths (srcpath, dstpath, callback) {
|
||||
'toDst': srcpath
|
||||
})
|
||||
} else {
|
||||
return fs.lstat(srcpath, (err, stat) => {
|
||||
return fs.lstat(srcpath, (err) => {
|
||||
if (err) {
|
||||
err.message = err.message.replace('lstat', 'ensureSymlink')
|
||||
return callback(err)
|
||||
|
||||
5
node_modules/fs-extra/lib/ensure/symlink.js
generated
vendored
5
node_modules/fs-extra/lib/ensure/symlink.js
generated
vendored
@@ -43,10 +43,7 @@ function createSymlink (srcpath, dstpath, type, callback) {
|
||||
})
|
||||
}
|
||||
|
||||
function createSymlinkSync (srcpath, dstpath, type, callback) {
|
||||
callback = (typeof type === 'function') ? type : callback
|
||||
type = (typeof type === 'function') ? false : type
|
||||
|
||||
function createSymlinkSync (srcpath, dstpath, type) {
|
||||
const destinationExists = fs.existsSync(dstpath)
|
||||
if (destinationExists) return undefined
|
||||
|
||||
|
||||
Reference in New Issue
Block a user