mirror of
https://github.com/titanscouting/tra-analysis.git
synced 2025-09-06 15:07:21 +00:00
push all website files
This commit is contained in:
57
website/node_modules/npm/lib/doctor/check-files-permission.js
generated
vendored
Normal file
57
website/node_modules/npm/lib/doctor/check-files-permission.js
generated
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
var fs = require('fs')
|
||||
var path = require('path')
|
||||
var getUid = require('uid-number')
|
||||
var chain = require('slide').chain
|
||||
var log = require('npmlog')
|
||||
var npm = require('../npm.js')
|
||||
var fileCompletion = require('../utils/completion/file-completion.js')
|
||||
|
||||
function checkFilesPermission (root, fmask, dmask, cb) {
|
||||
if (process.platform === 'win32') return cb(null, true)
|
||||
getUid(npm.config.get('user'), npm.config.get('group'), function (e, uid, gid) {
|
||||
var tracker = log.newItem('checkFilePermissions', 1)
|
||||
if (e) {
|
||||
tracker.finish()
|
||||
tracker.warn('checkFilePermissions', 'Error looking up user and group:', e)
|
||||
return cb(e)
|
||||
}
|
||||
tracker.info('checkFilePermissions', 'Building file list of ' + root)
|
||||
fileCompletion(root, '.', Infinity, function (e, files) {
|
||||
if (e) {
|
||||
tracker.warn('checkFilePermissions', 'Error building file list:', e)
|
||||
tracker.finish()
|
||||
return cb(e)
|
||||
}
|
||||
tracker.addWork(files.length)
|
||||
tracker.completeWork(1)
|
||||
chain(files.map(andCheckFile), function (er) {
|
||||
tracker.finish()
|
||||
cb(null, !er)
|
||||
})
|
||||
function andCheckFile (f) {
|
||||
return [checkFile, f]
|
||||
}
|
||||
function checkFile (f, next) {
|
||||
var file = path.join(root, f)
|
||||
tracker.silly('checkFilePermissions', f)
|
||||
fs.lstat(file, function (e, stat) {
|
||||
tracker.completeWork(1)
|
||||
if (e) return next(e)
|
||||
if (!stat.isDirectory() && !stat.isFile()) return next()
|
||||
// 6 = fs.constants.R_OK | fs.constants.W_OK
|
||||
// constants aren't available on v4
|
||||
fs.access(file, stat.isFile() ? fmask : dmask, (err) => {
|
||||
if (err) {
|
||||
tracker.error('checkFilePermissions', `Missing permissions on ${file}`)
|
||||
return next(new Error('Missing permissions for ' + file))
|
||||
} else {
|
||||
return next()
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = checkFilesPermission
|
12
website/node_modules/npm/lib/doctor/check-ping.js
generated
vendored
Normal file
12
website/node_modules/npm/lib/doctor/check-ping.js
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
var log = require('npmlog')
|
||||
var ping = require('../ping.js')
|
||||
|
||||
function checkPing (cb) {
|
||||
var tracker = log.newItem('checkPing', 1)
|
||||
tracker.info('checkPing', 'Pinging registry')
|
||||
ping({}, true, (_err, pong, data, res) => {
|
||||
cb(null, [res.statusCode, res.statusMessage])
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = checkPing
|
13
website/node_modules/npm/lib/doctor/get-git-path.js
generated
vendored
Normal file
13
website/node_modules/npm/lib/doctor/get-git-path.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
var log = require('npmlog')
|
||||
var which = require('which')
|
||||
|
||||
function getGitPath (cb) {
|
||||
var tracker = log.newItem('getGitPath', 1)
|
||||
tracker.info('getGitPath', 'Finding git in your PATH')
|
||||
which('git', function (err, path) {
|
||||
tracker.finish()
|
||||
cb(err, path)
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = getGitPath
|
27
website/node_modules/npm/lib/doctor/get-latest-nodejs-version.js
generated
vendored
Normal file
27
website/node_modules/npm/lib/doctor/get-latest-nodejs-version.js
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
var log = require('npmlog')
|
||||
var request = require('request')
|
||||
var semver = require('semver')
|
||||
|
||||
function getLatestNodejsVersion (url, cb) {
|
||||
var tracker = log.newItem('getLatestNodejsVersion', 1)
|
||||
tracker.info('getLatestNodejsVersion', 'Getting Node.js release information')
|
||||
var version = 'v0.0.0'
|
||||
url = url || 'https://nodejs.org/dist/index.json'
|
||||
request(url, function (e, res, index) {
|
||||
tracker.finish()
|
||||
if (e) return cb(e)
|
||||
if (res.statusCode !== 200) {
|
||||
return cb(new Error('Status not 200, ' + res.statusCode))
|
||||
}
|
||||
try {
|
||||
JSON.parse(index).forEach(function (item) {
|
||||
if (item.lts && semver.gt(item.version, version)) version = item.version
|
||||
})
|
||||
cb(null, version)
|
||||
} catch (e) {
|
||||
cb(e)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = getLatestNodejsVersion
|
14
website/node_modules/npm/lib/doctor/get-latest-npm-version.js
generated
vendored
Normal file
14
website/node_modules/npm/lib/doctor/get-latest-npm-version.js
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
var log = require('npmlog')
|
||||
var fetchPackageMetadata = require('../fetch-package-metadata')
|
||||
|
||||
function getLatestNpmVersion (cb) {
|
||||
var tracker = log.newItem('getLatestNpmVersion', 1)
|
||||
tracker.info('getLatestNpmVersion', 'Getting npm package information')
|
||||
fetchPackageMetadata('npm@latest', '.', {}, function (err, d) {
|
||||
tracker.finish()
|
||||
if (err) { return cb(err) }
|
||||
cb(null, d.version)
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = getLatestNpmVersion
|
19
website/node_modules/npm/lib/doctor/verify-cached-files.js
generated
vendored
Normal file
19
website/node_modules/npm/lib/doctor/verify-cached-files.js
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
'use strict'
|
||||
|
||||
const cacache = require('cacache')
|
||||
const log = require('npmlog')
|
||||
|
||||
module.exports = verifyCachedFiles
|
||||
function verifyCachedFiles (cache, cb) {
|
||||
log.info('verifyCachedFiles', `Verifying cache at ${cache}`)
|
||||
cacache.verify(cache).then((stats) => {
|
||||
log.info('verifyCachedFiles', `Verification complete. Stats: ${JSON.stringify(stats, 2)}`)
|
||||
if (stats.reclaimedCount || stats.badContentCount || stats.missingContent) {
|
||||
stats.badContentCount && log.warn('verifyCachedFiles', `Corrupted content removed: ${stats.badContentCount}`)
|
||||
stats.reclaimedCount && log.warn('verifyCachedFiles', `Content garbage-collected: ${stats.reclaimedCount} (${stats.reclaimedSize} bytes)`)
|
||||
stats.missingContent && log.warn('verifyCachedFiles', `Missing content: ${stats.missingContent}`)
|
||||
log.warn('verifyCachedFiles', 'Cache issues have been fixed')
|
||||
}
|
||||
return stats
|
||||
}).then((s) => cb(null, s), cb)
|
||||
}
|
Reference in New Issue
Block a user