nav tabs on admin dashboard

This commit is contained in:
2019-03-07 00:20:34 -06:00
parent f73d6ae228
commit e4f473f376
11661 changed files with 216240 additions and 1544253 deletions

View File

@@ -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)) {

View File

@@ -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

View File

@@ -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)

View File

@@ -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