update
This commit is contained in:
parent
3fe1a78bd9
commit
00bfb6535a
1
dist/index.d.ts
vendored
Normal file
1
dist/index.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
||||
export * from './smartarchive.extract';
|
37
dist/index.js
vendored
37
dist/index.js
vendored
@ -1,32 +1,7 @@
|
||||
/// <reference path="./typings/tsd.d.ts" />
|
||||
/// <reference path="./remotezip.plugins.ts" />
|
||||
var plugins = RemotezipPlugins.init();
|
||||
var remotezip = {
|
||||
get: function (options) {
|
||||
if (!plugins.path.isAbsolute(options.toPath)) {
|
||||
plugins.beautylog.error("Please supply remotezip with an absolute path");
|
||||
return;
|
||||
"use strict";
|
||||
function __export(m) {
|
||||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
||||
}
|
||||
;
|
||||
plugins.gulp.task("remotezip", function () {
|
||||
plugins.beautylog.log('Now trying to download and extract...');
|
||||
var stream = plugins.g.remoteSrc(["master.zip"], {
|
||||
base: "https://github.com/UmbrellaZone/legaldocs/archive/"
|
||||
})
|
||||
.pipe(plugins.g.unzip())
|
||||
.pipe(plugins.gulp.dest(options.toPath));
|
||||
return stream;
|
||||
});
|
||||
plugins.gulp.task("default", ["remotezip"], function () {
|
||||
plugins.beautylog.success("Download complete and archive extracted");
|
||||
if (typeof options.cb == "function") {
|
||||
options.cb();
|
||||
}
|
||||
;
|
||||
});
|
||||
plugins.gulp.start.apply(plugins.gulp, ['default']);
|
||||
}
|
||||
};
|
||||
module.exports = remotezip;
|
||||
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLDJDQUEyQztBQUMzQywrQ0FBK0M7QUFFL0MsSUFBSSxPQUFPLEdBQUcsZ0JBQWdCLENBQUMsSUFBSSxFQUFFLENBQUM7QUFFdEMsSUFBSSxTQUFTLEdBQUc7SUFDWixHQUFHLEVBQUUsVUFBUyxPQU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yk7XG4gICAgICAgICAgICB2YXIgc3RyZWFtID0gcGx1Z2lucy5nLnJlbW90ZVNyYyhbXCJtYXN0ZXIuemlwXCJdLCB7XG4gICAgICAgICAgICAgICAgICAgIGJhc2U6IFwiaHR0cHM6Ly9naXRodWIuY29tL1VtYnJlbGxhWm9uZS9sZWdhbGRvY3MvYXJjaGl2ZS9cIlxuICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgLnBpcGUocGx1Z2lucy5nLnVuemlwKCkpXG4gICAgICAgICAgICAgICAgLnBpcGUocGx1Z2lucy5ndWxwLmRlc3Qob3B0aW9ucy50b1BhdGgpKTtcbiAgICAgICAgICAgIHJldHVybiBzdHJlYW07XG4gICAgICAgIH0pO1xuXG4gICAgICAgIHBsdWdpbnMuZ3VscC50YXNrKFwiZGVmYXVsdFwiLFtcInJlbW90ZXppcFwiXSwgZnVuY3Rpb24oKXtcbiAgICAgICAgICAgIHBsdWdpbnMuYmVhdXR5bG9nLnN1Y2Nlc3MoXCJEb3dubG9hZCBjb21wbGV0ZSBhbmQgYXJjaGl2ZSBleHRyYWN0ZWRcIik7XG4gICAgICAgICAgICBpZih0eXBlb2Ygb3B0aW9ucy5jYiA9PSBcImZ1bmN0aW9uXCIpe1xuICAgICAgICAgICAgICAgIG9wdGlvbnMuY2IoKTtcbiAgICAgICAgICAgIH07XG4gICAgICAgIH0pO1xuXG4gICAgICAgIHBsdWdpbnMuZ3VscC5zdGFydC5hcHBseShwbHVnaW5zLmd1bHAsIFsnZGVmYXVsdCddKTtcbiAgICB9XG59O1xubW9kdWxlLmV4cG9ydHMgPSByZW1vdGV6aXA7Il0sInNvdXJjZVJvb3QiOiIvc291cmNlLyJ9
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
__export(require("./smartarchive.extract"));
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUFBLDRDQUFzQyJ9
|
18
dist/remotezip.plugins.js
vendored
18
dist/remotezip.plugins.js
vendored
@ -1,18 +0,0 @@
|
||||
/// <reference path="./index.ts" />
|
||||
var RemotezipPlugins;
|
||||
(function (RemotezipPlugins) {
|
||||
RemotezipPlugins.init = function () {
|
||||
var plugins = {
|
||||
beautylog: require("beautylog"),
|
||||
gulp: require("gulp"),
|
||||
g: {
|
||||
unzip: require("gulp-unzip"),
|
||||
remoteSrc: require("gulp-remote-src")
|
||||
},
|
||||
path: require("path")
|
||||
};
|
||||
return plugins;
|
||||
};
|
||||
})(RemotezipPlugins || (RemotezipPlugins = {}));
|
||||
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInJlbW90ZXppcC5wbHVnaW5zLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLG1DQUFtQztBQUNuQyxJQUFPLGdCQUFnQixDQWF0QjtBQWJELFdBQU8sZ0JBQWdCLEVBQUMsQ0FBQztJQUNWLHFCQUFJLEdBQUc7UUFDZCxJQUFJLE9BQU8sR0FBRztZQUNWLFNBQVMsRUFBRSxPQUFPLENBQUMsV0FBVyxDQUFDO1lBQy9CLElBQUksRUFBRSxPQUFPLENBQUMsTUFBTSxDQUFDO1lBQ3JCLENBQUMsRUFBQztnQkFDRSxLQUFLLEVBQUUsT0FBTyxDQUFDLFlBQVksQ0FBQztnQkFDNUIsU0FBUyxFQUFFLE9BQU8sQ0FBQyxpQkFBaUIsQ0FBQzthQUN4QztZQUNELElBQUksRUFBRSxPQUFPLENBQUMsTUFBTSxDQUFDO1NBQ3hCLENBQUM7UUFDRixNQUFNLENBQUMsT0FBTyxDQUFDO0lBQ25CLENBQUMsQ0FBQTtBQUNMLENBQUMsRUFiTSxnQkFBZ0IsS0FBaEIsZ0JBQWdCLFFBYXRCIiwiZmlsZSI6InJlbW90ZXppcC5wbHVnaW5zLmpzIiwic291cmNlc0NvbnRlbnQiOlsiLy8vIDxyZWZlcmVuY2UgcGF0aD1cIi4vaW5kZXgudHNcIiAvPlxubW9kdWxlIFJlbW90ZXppcFBsdWdpbnMge1xuICAgIGV4cG9ydCB2YXIgaW5pdCA9IGZ1bmN0aW9uKCkge1xuICAgICAgICB2YXIgcGx1Z2lucyA9IHtcbiAgICAgICAgICAgIGJlYXV0eWxvZzogcmVxdWlyZShcImJlYXV0eWxvZ1wiKSxcbiAgICAgICAgICAgIGd1bHA6IHJlcXVpcmUoXCJndWxwXCIpLFxuICAgICAgICAgICAgZzp7XG4gICAgICAgICAgICAgICAgdW56aXA6IHJlcXVpcmUoXCJndWxwLXVuemlwXCIpLFxuICAgICAgICAgICAgICAgIHJlbW90ZVNyYzogcmVxdWlyZShcImd1bHAtcmVtb3RlLXNyY1wiKVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHBhdGg6IHJlcXVpcmUoXCJwYXRoXCIpXG4gICAgICAgIH07XG4gICAgICAgIHJldHVybiBwbHVnaW5zO1xuICAgIH1cbn0iXSwic291cmNlUm9vdCI6Ii9zb3VyY2UvIn0=
|
5
dist/smartarchive.extract.d.ts
vendored
Normal file
5
dist/smartarchive.extract.d.ts
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
export declare let toFS: (options: {
|
||||
from: string;
|
||||
toPath: string;
|
||||
cb?: any;
|
||||
}) => void;
|
0
dist/smartarchive.extract.helpers.d.ts
vendored
Normal file
0
dist/smartarchive.extract.helpers.d.ts
vendored
Normal file
1
dist/smartarchive.extract.helpers.js
vendored
Normal file
1
dist/smartarchive.extract.helpers.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRhcmNoaXZlLmV4dHJhY3QuaGVscGVycy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3NtYXJ0YXJjaGl2ZS5leHRyYWN0LmhlbHBlcnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiJ9
|
28
dist/smartarchive.extract.js
vendored
Normal file
28
dist/smartarchive.extract.js
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const plugins = require("./smartarchive.plugins");
|
||||
exports.toFS = function (options) {
|
||||
if (!plugins.path.isAbsolute(options.toPath)) {
|
||||
plugins.beautylog.error('Please supply remotezip with an absolute path');
|
||||
return;
|
||||
}
|
||||
;
|
||||
plugins.gulp.task('remotezip', function () {
|
||||
plugins.beautylog.log('Now trying to download and extract...');
|
||||
let stream = plugins.g.remoteSrc(['master.zip'], {
|
||||
base: 'https://github.com/UmbrellaZone/legaldocs/archive/'
|
||||
})
|
||||
.pipe(plugins.g.unzip())
|
||||
.pipe(plugins.gulp.dest(options.toPath));
|
||||
return stream;
|
||||
});
|
||||
plugins.gulp.task('default', ['remotezip'], function () {
|
||||
plugins.beautylog.success('Download complete and archive extracted');
|
||||
if (typeof options.cb === 'function') {
|
||||
options.cb();
|
||||
}
|
||||
;
|
||||
});
|
||||
plugins.gulp.start.apply(plugins.gulp, ['default']);
|
||||
};
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRhcmNoaXZlLmV4dHJhY3QuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9zbWFydGFyY2hpdmUuZXh0cmFjdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLGtEQUFrRDtBQUN2QyxRQUFBLElBQUksR0FBRyxVQUFVLE9BQTZDO0lBRXZFLEVBQUUsQ0FBQyxDQUFDLENBQUMsT0FBTyxDQUFDLElBQUksQ0FBQyxVQUFVLENBQUMsT0FBTyxDQUFDLE1BQU0sQ0FBQyxDQUFDLENBQUMsQ0FB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EVBQUUsQ0FBRSxTQUFTLENBQUUsQ0FBQyxDQUFBO0FBQ3ZELENBQUMsQ0FBQSJ9
|
10
dist/smartarchive.plugins.d.ts
vendored
Normal file
10
dist/smartarchive.plugins.d.ts
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
import 'typings-global';
|
||||
export import beautylog = require('beautylog');
|
||||
export declare let g: {
|
||||
unzip: any;
|
||||
remoteSrc: any;
|
||||
};
|
||||
export import gulp = require('gulp');
|
||||
export import path = require('path');
|
||||
export import smartfile = require('smartfile');
|
||||
export import smartpath = require('smartpath');
|
13
dist/smartarchive.plugins.js
vendored
Normal file
13
dist/smartarchive.plugins.js
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
require("typings-global");
|
||||
exports.beautylog = require("beautylog");
|
||||
exports.g = {
|
||||
unzip: require('gulp-unzip'),
|
||||
remoteSrc: require('gulp-remote-src')
|
||||
};
|
||||
exports.gulp = require("gulp");
|
||||
exports.path = require("path");
|
||||
exports.smartfile = require("smartfile");
|
||||
exports.smartpath = require("smartpath");
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRhcmNoaXZlLnBsdWdpbnMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9zbWFydGFyY2hpdmUucGx1Z2lucy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLDBCQUF1QjtBQUN2Qix5Q0FBOEM7QUFDbkMsUUFBQSxDQUFDLEdBQUc7SUFDWCxLQUFLLEVBQUUsT0FBTyxDQUFDLFlBQVksQ0FBQztJQUM1QixTQUFTLEVBQUUsT0FBTyxDQUFDLGlCQUFpQixDQUFDO0NBQ3hDLENBQUE7QUFDRCwrQkFBb0M7QUFDcEMsK0JBQW9DO0FBQ3BDLHlDQUE4QztBQUM5Qyx5Q0FBOEMifQ==
|
7
npmextra.json
Normal file
7
npmextra.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"npmci": {
|
||||
"globalNpmTools": [
|
||||
"npmts"
|
||||
]
|
||||
}
|
||||
}
|
@ -2,7 +2,8 @@
|
||||
"name": "smartarchive",
|
||||
"version": "1.0.3",
|
||||
"description": "work with archives",
|
||||
"main": "index.js",
|
||||
"main": "dist/index.js",
|
||||
"typings": "dist/index.d.ts",
|
||||
"scripts": {
|
||||
"test": "(npmts)",
|
||||
"testm": "(npm test) && (node test.js)"
|
||||
@ -18,11 +19,13 @@
|
||||
},
|
||||
"homepage": "https://github.com/pushrocks/smartarchive#readme",
|
||||
"dependencies": {
|
||||
"@types/gulp": "^4.0.0",
|
||||
"beautylog": "^6.1.5",
|
||||
"gulp": "^3.9.1",
|
||||
"gulp-remote-src": "^0.4.2",
|
||||
"gulp-unzip": "^0.2.0",
|
||||
"smartfile": "^4.1.8",
|
||||
"smartpath": "^3.2.8"
|
||||
},
|
||||
"devDependencies": {
|
||||
}
|
||||
"devDependencies": {}
|
||||
}
|
||||
|
0
test/test.d.ts
vendored
Normal file
0
test/test.d.ts
vendored
Normal file
12
test/test.js
12
test/test.js
@ -1,11 +1 @@
|
||||
/// <reference path="../ts/typings/main.d.ts" />
|
||||
var smartarchive = require("./index.js");
|
||||
var path = require("path");
|
||||
smartarchive.get({
|
||||
from: "https://github.com/UmbrellaZone/legaldocs/archive/master.zip",
|
||||
toPath: path.resolve("./test/"),
|
||||
cb: function () {
|
||||
console.log("This is a callback");
|
||||
}
|
||||
});
|
||||
//# sourceMappingURL=test.js.map
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiJ9
|
11
test/test.ts
11
test/test.ts
@ -1,11 +0,0 @@
|
||||
/// <reference path="../ts/typings/main.d.ts" />
|
||||
var smartarchive = require("./index.js");
|
||||
var path = require("path");
|
||||
|
||||
smartarchive.get({
|
||||
from:"https://github.com/UmbrellaZone/legaldocs/archive/master.zip",
|
||||
toPath:path.resolve("./test/"),
|
||||
cb: function(){
|
||||
console.log("This is a callback")
|
||||
}
|
||||
});
|
@ -1,6 +1 @@
|
||||
import plugins = require("./smartarchive.plugins");
|
||||
|
||||
var smartarchive = {
|
||||
|
||||
};
|
||||
export = smartarchive;
|
||||
export * from './smartarchive.extract'
|
||||
|
@ -1,26 +1,26 @@
|
||||
import plugins = require("./smartarchive.plugins");
|
||||
import plugins = require('./smartarchive.plugins')
|
||||
export let toFS = function (options: { from: string, toPath: string, cb?}) {
|
||||
|
||||
if (!plugins.path.isAbsolute(options.toPath)) { // check wether supplied path is absolute
|
||||
plugins.beautylog.error("Please supply remotezip with an absolute path");
|
||||
return;
|
||||
plugins.beautylog.error('Please supply remotezip with an absolute path')
|
||||
return
|
||||
};
|
||||
plugins.gulp.task("remotezip", function () {
|
||||
plugins.beautylog.log('Now trying to download and extract...');
|
||||
var stream = plugins.g.remoteSrc(["master.zip"], {
|
||||
base: "https://github.com/UmbrellaZone/legaldocs/archive/"
|
||||
plugins.gulp.task('remotezip', function () {
|
||||
plugins.beautylog.log('Now trying to download and extract...')
|
||||
let stream = plugins.g.remoteSrc([ 'master.zip' ], {
|
||||
base: 'https://github.com/UmbrellaZone/legaldocs/archive/'
|
||||
})
|
||||
.pipe(plugins.g.unzip())
|
||||
.pipe(plugins.gulp.dest(options.toPath));
|
||||
return stream;
|
||||
});
|
||||
.pipe(plugins.gulp.dest(options.toPath))
|
||||
return stream
|
||||
})
|
||||
|
||||
plugins.gulp.task("default",["remotezip"], function(){
|
||||
plugins.beautylog.success("Download complete and archive extracted");
|
||||
if(typeof options.cb == "function"){
|
||||
options.cb();
|
||||
plugins.gulp.task('default', [ 'remotezip' ], function () {
|
||||
plugins.beautylog.success('Download complete and archive extracted')
|
||||
if (typeof options.cb === 'function') {
|
||||
options.cb()
|
||||
};
|
||||
});
|
||||
})
|
||||
|
||||
plugins.gulp.start.apply(plugins.gulp, ['default']);
|
||||
};
|
||||
plugins.gulp.start.apply(plugins.gulp, [ 'default' ])
|
||||
}
|
@ -1,8 +1,10 @@
|
||||
import 'typings-global'
|
||||
export let beautylog = require("beautylog");
|
||||
export import beautylog = require('beautylog')
|
||||
export let g = {
|
||||
unzip: require("gulp-unzip"),
|
||||
};
|
||||
export let path = require("path");
|
||||
export let smartfile = require("smartfile");
|
||||
export let smartpath = require("smartpath");
|
||||
unzip: require('gulp-unzip'),
|
||||
remoteSrc: require('gulp-remote-src')
|
||||
}
|
||||
export import gulp = require('gulp')
|
||||
export import path = require('path')
|
||||
export import smartfile = require('smartfile')
|
||||
export import smartpath = require('smartpath')
|
||||
|
Loading…
Reference in New Issue
Block a user