cleanup
This commit is contained in:
37
ts/index.ts
37
ts/index.ts
@ -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;
|
@ -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;
|
||||
}
|
||||
}
|
0
ts/smartarchive.extract.helpers.ts
Normal file
0
ts/smartarchive.extract.helpers.ts
Normal file
26
ts/smartarchive.extract.ts
Normal file
26
ts/smartarchive.extract.ts
Normal 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']);
|
||||
};
|
8
ts/smartarchive.plugins.ts
Normal file
8
ts/smartarchive.plugins.ts
Normal 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");
|
12
ts/tsd.json
12
ts/tsd.json
@ -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"
|
||||
}
|
||||
}
|
||||
}
|
2079
ts/typings/node/node.d.ts
vendored
2079
ts/typings/node/node.d.ts
vendored
File diff suppressed because it is too large
Load Diff
1
ts/typings/tsd.d.ts
vendored
1
ts/typings/tsd.d.ts
vendored
@ -1 +0,0 @@
|
||||
/// <reference path="node/node.d.ts" />
|
Reference in New Issue
Block a user