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

remove electron-in-page-search

This commit is contained in:
s2
2019-06-06 15:44:24 +02:00
parent e2a57318a7
commit c5f9b551ab
92637 changed files with 636010 additions and 15 deletions

1
app/node_modules/extract-zip/.npmignore generated vendored Normal file
View File

@@ -0,0 +1 @@
test/

9
app/node_modules/extract-zip/.travis.yml generated vendored Normal file
View File

@@ -0,0 +1,9 @@
sudo: false
language: node_js
node_js:
- '0.12'
- 'iojs'
- '4'
- '6'
- '8'
- '10'

1
app/node_modules/extract-zip/CONTRIBUTING.md generated vendored Normal file
View File

@@ -0,0 +1 @@
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 Normal file
View File

@@ -0,0 +1,23 @@
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 Normal file
View File

@@ -0,0 +1,20 @@
#!/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 Normal file
View File

@@ -0,0 +1,205 @@
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)
})
}))
}
})
})
}
})
}
}

70
app/node_modules/extract-zip/package.json generated vendored Normal file
View File

@@ -0,0 +1,70 @@
{
"_from": "extract-zip@^1.0.3",
"_id": "extract-zip@1.6.7",
"_inBundle": false,
"_integrity": "sha1-qEC0uK9kAyZMjbV/Txp0Mz74H+k=",
"_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",
"/electron-packager"
],
"_resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-1.6.7.tgz",
"_shasum": "a840b4b8af6403264c8db57f4f1a74333ef81fe9",
"_spec": "extract-zip@^1.0.3",
"_where": "F:\\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.2",
"debug": "2.6.9",
"mkdirp": "0.5.1",
"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.7"
}

49
app/node_modules/extract-zip/readme.md generated vendored Normal file
View File

@@ -0,0 +1,49 @@
# 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.
[![NPM](https://nodei.co/npm/extract-zip.png?global=true)](https://nodei.co/npm/extract-zip/)
[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard)
[![Build Status](https://travis-ci.org/maxogden/extract-zip.svg?branch=master)](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()`.