1
0
mirror of https://github.com/S2-/gitlit synced 2025-08-04 13:10:09 +02:00

update dependencies

This commit is contained in:
s2
2018-10-10 15:11:12 +02:00
parent da4083f574
commit 5c55c54b71
90877 changed files with 339776 additions and 33677 deletions

View File

@@ -1,7 +1,8 @@
var path = require('path')
// path.isAbsolute shim for Node.js 0.10 support
path.isAbsolute = (path.isAbsolute) ? path.isAbsolute : require('path-is-absolute')
var fs = require('graceful-fs')
'use strict'
const path = require('path')
const fs = require('graceful-fs')
const pathExists = require('../path-exists').pathExists
/**
* Function that returns two types of paths, one relative to symlink, and one
@@ -27,7 +28,7 @@ var fs = require('graceful-fs')
function symlinkPaths (srcpath, dstpath, callback) {
if (path.isAbsolute(srcpath)) {
return fs.lstat(srcpath, function (err, stat) {
return fs.lstat(srcpath, (err, stat) => {
if (err) {
err.message = err.message.replace('lstat', 'ensureSymlink')
return callback(err)
@@ -38,16 +39,17 @@ function symlinkPaths (srcpath, dstpath, callback) {
})
})
} else {
var dstdir = path.dirname(dstpath)
var relativeToDst = path.join(dstdir, srcpath)
return fs.exists(relativeToDst, function (exists) {
const dstdir = path.dirname(dstpath)
const relativeToDst = path.join(dstdir, srcpath)
return pathExists(relativeToDst, (err, exists) => {
if (err) return callback(err)
if (exists) {
return callback(null, {
'toCwd': relativeToDst,
'toDst': srcpath
})
} else {
return fs.lstat(srcpath, function (err, stat) {
return fs.lstat(srcpath, (err, stat) => {
if (err) {
err.message = err.message.replace('lstat', 'ensureSymlink')
return callback(err)
@@ -63,7 +65,7 @@ function symlinkPaths (srcpath, dstpath, callback) {
}
function symlinkPathsSync (srcpath, dstpath) {
var exists
let exists
if (path.isAbsolute(srcpath)) {
exists = fs.existsSync(srcpath)
if (!exists) throw new Error('absolute srcpath does not exist')
@@ -72,8 +74,8 @@ function symlinkPathsSync (srcpath, dstpath) {
'toDst': srcpath
}
} else {
var dstdir = path.dirname(dstpath)
var relativeToDst = path.join(dstdir, srcpath)
const dstdir = path.dirname(dstpath)
const relativeToDst = path.join(dstdir, srcpath)
exists = fs.existsSync(relativeToDst)
if (exists) {
return {
@@ -92,6 +94,6 @@ function symlinkPathsSync (srcpath, dstpath) {
}
module.exports = {
'symlinkPaths': symlinkPaths,
'symlinkPathsSync': symlinkPathsSync
symlinkPaths,
symlinkPathsSync
}