This commit is contained in:
2017-03-12 22:16:48 +01:00
parent 13c82ce689
commit a602c68d8b
20 changed files with 1137 additions and 2251 deletions

View File

@ -1,35 +1,8 @@
/// <reference path="./typings/tsd.d.ts" />
/// <reference path="./remotezip.plugins.ts" />
/// <reference path="./typings/main.d.ts" />
var plugins = RemotezipPlugins.init();
import plugins = require("./smartarchive.plugins");
var remotezip = {
get: 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.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']);
}
var smartarchive = {
};
module.exports = remotezip;
export = smartarchive;

View File

@ -1,15 +0,0 @@
/// <reference path="./index.ts" />
module RemotezipPlugins {
export var 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;
}
}

View File

View File

@ -0,0 +1,26 @@
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.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']);
};

View File

@ -0,0 +1,8 @@
import 'typings-global'
export let 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");

View File

@ -1,12 +0,0 @@
{
"version": "v4",
"repo": "borisyankov/DefinitelyTyped",
"ref": "master",
"path": "typings",
"bundle": "typings/tsd.d.ts",
"installed": {
"node/node.d.ts": {
"commit": "efa0c1196d7280640e624ac1e7fa604502e7bd63"
}
}
}

File diff suppressed because it is too large Load Diff

1
ts/typings/tsd.d.ts vendored
View File

@ -1 +0,0 @@
/// <reference path="node/node.d.ts" />