mirror of
https://github.com/S2-/gitlit
synced 2025-08-03 21:00:04 +02:00
remove node_modules
This commit is contained in:
1
app/node_modules/extract-zip/.npmignore
generated
vendored
1
app/node_modules/extract-zip/.npmignore
generated
vendored
@@ -1 +0,0 @@
|
||||
test/
|
7
app/node_modules/extract-zip/.travis.yml
generated
vendored
7
app/node_modules/extract-zip/.travis.yml
generated
vendored
@@ -1,7 +0,0 @@
|
||||
sudo: false
|
||||
language: node_js
|
||||
node_js:
|
||||
- '0.12'
|
||||
- 'iojs'
|
||||
- '4.0'
|
||||
- '6.0'
|
1
app/node_modules/extract-zip/CONTRIBUTING.md
generated
vendored
1
app/node_modules/extract-zip/CONTRIBUTING.md
generated
vendored
@@ -1 +0,0 @@
|
||||
Before potentially wasting your time by making major, opinionated changes to this codebase please feel free to open a discussion repos in the Issues section of the repository. Outline your proposed idea and seek feedback from the maintainer first before implementing major features.
|
23
app/node_modules/extract-zip/LICENSE
generated
vendored
23
app/node_modules/extract-zip/LICENSE
generated
vendored
@@ -1,23 +0,0 @@
|
||||
Copyright (c) 2014 Max Ogden and other contributors
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
20
app/node_modules/extract-zip/cli.js
generated
vendored
20
app/node_modules/extract-zip/cli.js
generated
vendored
@@ -1,20 +0,0 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
var extract = require('./')
|
||||
|
||||
var args = process.argv.slice(2)
|
||||
var source = args[0]
|
||||
var dest = args[1] || process.cwd()
|
||||
if (!source) {
|
||||
console.error('Usage: extract-zip foo.zip <targetDirectory>')
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
extract(source, {dir: dest}, function (err, results) {
|
||||
if (err) {
|
||||
console.error('error!', err)
|
||||
process.exit(1)
|
||||
} else {
|
||||
process.exit(0)
|
||||
}
|
||||
})
|
205
app/node_modules/extract-zip/index.js
generated
vendored
205
app/node_modules/extract-zip/index.js
generated
vendored
@@ -1,205 +0,0 @@
|
||||
var fs = require('fs')
|
||||
var path = require('path')
|
||||
var yauzl = require('yauzl')
|
||||
var mkdirp = require('mkdirp')
|
||||
var concat = require('concat-stream')
|
||||
var debug = require('debug')('extract-zip')
|
||||
|
||||
module.exports = function (zipPath, opts, cb) {
|
||||
debug('creating target directory', opts.dir)
|
||||
|
||||
if (path.isAbsolute(opts.dir) === false) {
|
||||
return cb(new Error('Target directory is expected to be absolute'))
|
||||
}
|
||||
|
||||
mkdirp(opts.dir, function (err) {
|
||||
if (err) return cb(err)
|
||||
|
||||
fs.realpath(opts.dir, function (err, canonicalDir) {
|
||||
if (err) return cb(err)
|
||||
|
||||
opts.dir = canonicalDir
|
||||
|
||||
openZip(opts)
|
||||
})
|
||||
})
|
||||
|
||||
function openZip () {
|
||||
debug('opening', zipPath, 'with opts', opts)
|
||||
|
||||
yauzl.open(zipPath, {lazyEntries: true}, function (err, zipfile) {
|
||||
if (err) return cb(err)
|
||||
|
||||
var cancelled = false
|
||||
|
||||
zipfile.readEntry()
|
||||
|
||||
zipfile.on('close', function () {
|
||||
if (!cancelled) {
|
||||
debug('zip extraction complete')
|
||||
cb()
|
||||
}
|
||||
})
|
||||
|
||||
zipfile.on('entry', function (entry) {
|
||||
if (cancelled) {
|
||||
debug('skipping entry', entry.fileName, {cancelled: cancelled})
|
||||
return
|
||||
}
|
||||
|
||||
debug('zipfile entry', entry.fileName)
|
||||
|
||||
if (/^__MACOSX\//.test(entry.fileName)) {
|
||||
// dir name starts with __MACOSX/
|
||||
zipfile.readEntry()
|
||||
return
|
||||
}
|
||||
|
||||
var destDir = path.dirname(path.join(opts.dir, entry.fileName))
|
||||
|
||||
mkdirp(destDir, function (err) {
|
||||
if (err) {
|
||||
cancelled = true
|
||||
zipfile.close()
|
||||
return cb(err)
|
||||
}
|
||||
|
||||
fs.realpath(destDir, function (err, canonicalDestDir) {
|
||||
if (err) {
|
||||
cancelled = true
|
||||
zipfile.close()
|
||||
return cb(err)
|
||||
}
|
||||
|
||||
var relativeDestDir = path.relative(opts.dir, canonicalDestDir)
|
||||
|
||||
if (relativeDestDir.split(path.sep).indexOf('..') !== -1) {
|
||||
cancelled = true
|
||||
zipfile.close()
|
||||
return cb(new Error('Out of bound path "' + canonicalDestDir + '" found while processing file ' + entry.fileName))
|
||||
}
|
||||
|
||||
extractEntry(entry, function (err) {
|
||||
// if any extraction fails then abort everything
|
||||
if (err) {
|
||||
cancelled = true
|
||||
zipfile.close()
|
||||
return cb(err)
|
||||
}
|
||||
debug('finished processing', entry.fileName)
|
||||
zipfile.readEntry()
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
function extractEntry (entry, done) {
|
||||
if (cancelled) {
|
||||
debug('skipping entry extraction', entry.fileName, {cancelled: cancelled})
|
||||
return setImmediate(done)
|
||||
}
|
||||
|
||||
if (opts.onEntry) {
|
||||
opts.onEntry(entry, zipfile)
|
||||
}
|
||||
|
||||
var dest = path.join(opts.dir, entry.fileName)
|
||||
|
||||
// convert external file attr int into a fs stat mode int
|
||||
var mode = (entry.externalFileAttributes >> 16) & 0xFFFF
|
||||
// check if it's a symlink or dir (using stat mode constants)
|
||||
var IFMT = 61440
|
||||
var IFDIR = 16384
|
||||
var IFLNK = 40960
|
||||
var symlink = (mode & IFMT) === IFLNK
|
||||
var isDir = (mode & IFMT) === IFDIR
|
||||
|
||||
// Failsafe, borrowed from jsZip
|
||||
if (!isDir && entry.fileName.slice(-1) === '/') {
|
||||
isDir = true
|
||||
}
|
||||
|
||||
// check for windows weird way of specifying a directory
|
||||
// https://github.com/maxogden/extract-zip/issues/13#issuecomment-154494566
|
||||
var madeBy = entry.versionMadeBy >> 8
|
||||
if (!isDir) isDir = (madeBy === 0 && entry.externalFileAttributes === 16)
|
||||
|
||||
// if no mode then default to default modes
|
||||
if (mode === 0) {
|
||||
if (isDir) {
|
||||
if (opts.defaultDirMode) mode = parseInt(opts.defaultDirMode, 10)
|
||||
if (!mode) mode = 493 // Default to 0755
|
||||
} else {
|
||||
if (opts.defaultFileMode) mode = parseInt(opts.defaultFileMode, 10)
|
||||
if (!mode) mode = 420 // Default to 0644
|
||||
}
|
||||
}
|
||||
|
||||
debug('extracting entry', { filename: entry.fileName, isDir: isDir, isSymlink: symlink })
|
||||
|
||||
// reverse umask first (~)
|
||||
var umask = ~process.umask()
|
||||
// & with processes umask to override invalid perms
|
||||
var procMode = mode & umask
|
||||
|
||||
// always ensure folders are created
|
||||
var destDir = dest
|
||||
if (!isDir) destDir = path.dirname(dest)
|
||||
|
||||
debug('mkdirp', {dir: destDir})
|
||||
mkdirp(destDir, function (err) {
|
||||
if (err) {
|
||||
debug('mkdirp error', destDir, {error: err})
|
||||
cancelled = true
|
||||
return done(err)
|
||||
}
|
||||
|
||||
if (isDir) return done()
|
||||
|
||||
debug('opening read stream', dest)
|
||||
zipfile.openReadStream(entry, function (err, readStream) {
|
||||
if (err) {
|
||||
debug('openReadStream error', err)
|
||||
cancelled = true
|
||||
return done(err)
|
||||
}
|
||||
|
||||
readStream.on('error', function (err) {
|
||||
console.log('read err', err)
|
||||
})
|
||||
|
||||
if (symlink) writeSymlink()
|
||||
else writeStream()
|
||||
|
||||
function writeStream () {
|
||||
var writeStream = fs.createWriteStream(dest, {mode: procMode})
|
||||
readStream.pipe(writeStream)
|
||||
|
||||
writeStream.on('finish', function () {
|
||||
done()
|
||||
})
|
||||
|
||||
writeStream.on('error', function (err) {
|
||||
debug('write error', {error: err})
|
||||
cancelled = true
|
||||
return done(err)
|
||||
})
|
||||
}
|
||||
|
||||
// AFAICT the content of the symlink file itself is the symlink target filename string
|
||||
function writeSymlink () {
|
||||
readStream.pipe(concat(function (data) {
|
||||
var link = data.toString()
|
||||
debug('creating symlink', link, dest)
|
||||
fs.symlink(link, dest, function (err) {
|
||||
if (err) cancelled = true
|
||||
done(err)
|
||||
})
|
||||
}))
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
69
app/node_modules/extract-zip/package.json
generated
vendored
69
app/node_modules/extract-zip/package.json
generated
vendored
@@ -1,69 +0,0 @@
|
||||
{
|
||||
"_from": "extract-zip@^1.0.3",
|
||||
"_id": "extract-zip@1.6.6",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-EpDt6NINCHK0Kf0/NRyhKOxe+Fw=",
|
||||
"_location": "/extract-zip",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "extract-zip@^1.0.3",
|
||||
"name": "extract-zip",
|
||||
"escapedName": "extract-zip",
|
||||
"rawSpec": "^1.0.3",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^1.0.3"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/electron"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-1.6.6.tgz",
|
||||
"_shasum": "1290ede8d20d0872b429fd3f351ca128ec5ef85c",
|
||||
"_spec": "extract-zip@^1.0.3",
|
||||
"_where": "E:\\projects\\p\\gitlit\\app\\node_modules\\electron",
|
||||
"author": {
|
||||
"name": "max ogden"
|
||||
},
|
||||
"bin": {
|
||||
"extract-zip": "cli.js"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/maxogden/extract-zip/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"concat-stream": "1.6.0",
|
||||
"debug": "2.6.9",
|
||||
"mkdirp": "0.5.0",
|
||||
"yauzl": "2.4.1"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "unzip a zip file into a directory using 100% javascript",
|
||||
"devDependencies": {
|
||||
"rimraf": "^2.2.8",
|
||||
"standard": "^5.2.2",
|
||||
"tape": "^4.2.0",
|
||||
"temp": "^0.8.3"
|
||||
},
|
||||
"directories": {
|
||||
"test": "test"
|
||||
},
|
||||
"homepage": "https://github.com/maxogden/extract-zip#readme",
|
||||
"keywords": [
|
||||
"unzip",
|
||||
"zip",
|
||||
"extract"
|
||||
],
|
||||
"license": "BSD-2-Clause",
|
||||
"main": "index.js",
|
||||
"name": "extract-zip",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/maxogden/extract-zip.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "standard && node test/test.js"
|
||||
},
|
||||
"version": "1.6.6"
|
||||
}
|
49
app/node_modules/extract-zip/readme.md
generated
vendored
49
app/node_modules/extract-zip/readme.md
generated
vendored
@@ -1,49 +0,0 @@
|
||||
# extract-zip
|
||||
|
||||
Unzip written in pure JavaScript. Extracts a zip into a directory. Available as a library or a command line program.
|
||||
|
||||
Uses the [`yauzl`](http://npmjs.org/yauzl) ZIP parser.
|
||||
|
||||
[](https://nodei.co/npm/extract-zip/)
|
||||
[](https://github.com/feross/standard)
|
||||
[](https://travis-ci.org/maxogden/extract-zip)
|
||||
|
||||
## Installation
|
||||
|
||||
Get the library:
|
||||
|
||||
```
|
||||
npm install extract-zip --save
|
||||
```
|
||||
|
||||
Install the command line program:
|
||||
|
||||
```
|
||||
npm install extract-zip -g
|
||||
```
|
||||
|
||||
## JS API
|
||||
|
||||
```js
|
||||
var extract = require('extract-zip')
|
||||
extract(source, {dir: target}, function (err) {
|
||||
// extraction is complete. make sure to handle the err
|
||||
})
|
||||
```
|
||||
|
||||
### Options
|
||||
|
||||
- `dir` - defaults to `process.cwd()`
|
||||
- `defaultDirMode` - integer - Directory Mode (permissions) will default to `493` (octal `0755` in integer)
|
||||
- `defaultFileMode` - integer - File Mode (permissions) will default to `420` (octal `0644` in integer)
|
||||
- `onEntry` - function - if present, will be called with `(entry, zipfile)`, entry is every entry from the zip file forwarded from the `entry` event from yauzl. `zipfile` is the `yauzl` instance
|
||||
|
||||
Default modes are only used if no permissions are set in the zip file.
|
||||
|
||||
## CLI Usage
|
||||
|
||||
```
|
||||
extract-zip foo.zip <targetDirectory>
|
||||
```
|
||||
|
||||
If not specified, `targetDirectory` will default to `process.cwd()`.
|
Reference in New Issue
Block a user