added callback support

This commit is contained in:
2016-01-20 04:01:21 +01:00
parent 7a00a44a70
commit 2f4f325a86
5 changed files with 27 additions and 5 deletions

View File

@@ -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']);
}
};