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;
|
Reference in New Issue
Block a user