smartarchive/ts/index.ts

28 lines
956 B
TypeScript
Raw Normal View History

2016-01-18 18:38:55 +00:00
/// <reference path="./typings/tsd.d.ts" />
/// <reference path="./remotezip.plugins.ts" />
2016-01-18 21:17:24 +00:00
var plugins = RemotezipPlugins.init();
2016-01-20 02:30:03 +00:00
var remotezip = {
get: function(options:{from:string,toPath:string}){
2016-01-18 21:17:24 +00:00
2016-01-20 02:30:03 +00:00
if (!plugins.path.isAbsolute(options.toPath)) { //check wether supplied path is absolute
plugins.beautylog.error("Please supply remotezip with an absolute path");
return;
}
;
2016-01-18 21:17:24 +00:00
2016-01-20 02:30:03 +00:00
plugins.gulp.task('default', 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;
});
2016-01-18 21:17:24 +00:00
2016-01-20 02:30:03 +00:00
plugins.gulp.start.apply(plugins.gulp, ['default']);
}
2016-01-18 21:17:24 +00:00
};
module.exports = remotezip;