forked from enviPath/enviPy
Current Dev State
This commit is contained in:
74
static/js/ketcher2/node_modules/gulp-zip/index.js
generated
vendored
Normal file
74
static/js/ketcher2/node_modules/gulp-zip/index.js
generated
vendored
Normal file
@ -0,0 +1,74 @@
|
||||
'use strict';
|
||||
const path = require('path');
|
||||
const gutil = require('gulp-util');
|
||||
const through = require('through2');
|
||||
const Yazl = require('yazl');
|
||||
const getStream = require('get-stream');
|
||||
|
||||
module.exports = (filename, opts) => {
|
||||
if (!filename) {
|
||||
throw new gutil.PluginError('gulp-zip', '`filename` required');
|
||||
}
|
||||
|
||||
opts = Object.assign({
|
||||
compress: true
|
||||
}, opts);
|
||||
|
||||
let firstFile;
|
||||
const zip = new Yazl.ZipFile();
|
||||
|
||||
return through.obj((file, enc, cb) => {
|
||||
if (!firstFile) {
|
||||
firstFile = file;
|
||||
}
|
||||
|
||||
// Because Windows...
|
||||
const pathname = file.relative.replace(/\\/g, '/');
|
||||
|
||||
if (!pathname) {
|
||||
cb();
|
||||
return;
|
||||
}
|
||||
|
||||
if (file.isNull() && file.stat && file.stat.isDirectory && file.stat.isDirectory()) {
|
||||
zip.addEmptyDirectory(pathname, {
|
||||
mtime: file.stat.mtime || new Date(),
|
||||
mode: file.stat.mode
|
||||
});
|
||||
} else {
|
||||
const stat = {
|
||||
compress: opts.compress,
|
||||
mtime: file.stat ? file.stat.mtime : new Date(),
|
||||
mode: file.stat ? file.stat.mode : null
|
||||
};
|
||||
|
||||
if (file.isStream()) {
|
||||
zip.addReadStream(file.contents, pathname, stat);
|
||||
}
|
||||
|
||||
if (file.isBuffer()) {
|
||||
zip.addBuffer(file.contents, pathname, stat);
|
||||
}
|
||||
}
|
||||
|
||||
cb();
|
||||
}, function (cb) {
|
||||
if (!firstFile) {
|
||||
cb();
|
||||
return;
|
||||
}
|
||||
|
||||
getStream.buffer(zip.outputStream).then(data => {
|
||||
this.push(new gutil.File({
|
||||
cwd: firstFile.cwd,
|
||||
base: firstFile.base,
|
||||
path: path.join(firstFile.base, filename),
|
||||
contents: data
|
||||
}));
|
||||
|
||||
cb(); // eslint-disable-line promise/no-callback-in-promise
|
||||
});
|
||||
|
||||
zip.end();
|
||||
});
|
||||
};
|
||||
21
static/js/ketcher2/node_modules/gulp-zip/license
generated
vendored
Normal file
21
static/js/ketcher2/node_modules/gulp-zip/license
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
76
static/js/ketcher2/node_modules/gulp-zip/package.json
generated
vendored
Normal file
76
static/js/ketcher2/node_modules/gulp-zip/package.json
generated
vendored
Normal file
@ -0,0 +1,76 @@
|
||||
{
|
||||
"_from": "gulp-zip@4.0.0",
|
||||
"_id": "gulp-zip@4.0.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-HO/Ai0vzbfS1sefGs27lXrvkqIE=",
|
||||
"_location": "/gulp-zip",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "gulp-zip@4.0.0",
|
||||
"name": "gulp-zip",
|
||||
"escapedName": "gulp-zip",
|
||||
"rawSpec": "4.0.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "4.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"#DEV:/"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/gulp-zip/-/gulp-zip-4.0.0.tgz",
|
||||
"_shasum": "1cefc08b4bf36df4b5b1e7c6b36ee55ebbe4a881",
|
||||
"_spec": "gulp-zip@4.0.0",
|
||||
"_where": "/home/manfred/enviPath/ketcher2/ketcher",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/sindresorhus/gulp-zip/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"get-stream": "^3.0.0",
|
||||
"gulp-util": "^3.0.0",
|
||||
"through2": "^2.0.1",
|
||||
"yazl": "^2.1.0"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "ZIP compress files",
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"decompress-unzip": "^3.0.0",
|
||||
"gulp": "^3.9.1",
|
||||
"vinyl-assign": "^1.2.1",
|
||||
"vinyl-file": "^3.0.0",
|
||||
"xo": "*"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"homepage": "https://github.com/sindresorhus/gulp-zip#readme",
|
||||
"keywords": [
|
||||
"gulpplugin",
|
||||
"zip",
|
||||
"archive",
|
||||
"archiver",
|
||||
"compress",
|
||||
"compression",
|
||||
"file"
|
||||
],
|
||||
"license": "MIT",
|
||||
"name": "gulp-zip",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/sindresorhus/gulp-zip.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava"
|
||||
},
|
||||
"version": "4.0.0"
|
||||
}
|
||||
49
static/js/ketcher2/node_modules/gulp-zip/readme.md
generated
vendored
Normal file
49
static/js/ketcher2/node_modules/gulp-zip/readme.md
generated
vendored
Normal file
@ -0,0 +1,49 @@
|
||||
# gulp-zip [](https://travis-ci.org/sindresorhus/gulp-zip)
|
||||
|
||||
> ZIP compress files
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install --save-dev gulp-zip
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const gulp = require('gulp');
|
||||
const zip = require('gulp-zip');
|
||||
|
||||
gulp.task('default', () =>
|
||||
gulp.src('src/*')
|
||||
.pipe(zip('archive.zip'))
|
||||
.pipe(gulp.dest('dist'))
|
||||
);
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
Supports [streaming mode](https://github.com/gulpjs/gulp/blob/master/docs/API.md#optionsbuffer).
|
||||
|
||||
### zip(filename, [options])
|
||||
|
||||
#### filename
|
||||
|
||||
Type: `string`
|
||||
|
||||
#### options
|
||||
|
||||
Type: `Object`
|
||||
|
||||
##### compress
|
||||
|
||||
Type: `boolean`<br>
|
||||
Default: `true`
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
||||
Reference in New Issue
Block a user