added callback support
This commit is contained in:
11
ts/index.ts
11
ts/index.ts
@@ -4,7 +4,7 @@
|
||||
var plugins = RemotezipPlugins.init();
|
||||
|
||||
var remotezip = {
|
||||
get: function(options:{from:string,toPath:string}){
|
||||
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");
|
||||
@@ -12,7 +12,7 @@ var remotezip = {
|
||||
}
|
||||
;
|
||||
|
||||
plugins.gulp.task('default', function () {
|
||||
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/"
|
||||
@@ -22,6 +22,13 @@ var remotezip = {
|
||||
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']);
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user