This commit is contained in:
2017-03-12 22:35:36 +01:00
parent 3fe1a78bd9
commit 00bfb6535a
18 changed files with 1278 additions and 136 deletions

View File

@ -1,6 +1 @@
import plugins = require("./smartarchive.plugins");
var smartarchive = {
};
export = smartarchive;
export * from './smartarchive.extract'

View File

@ -1,26 +1,26 @@
import plugins = require("./smartarchive.plugins");
export let toFS = function(options:{from:string,toPath:string, cb?}){
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;
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...')
let 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.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']);
};
plugins.gulp.start.apply(plugins.gulp, [ 'default' ])
}

View File

@ -1,8 +1,10 @@
import 'typings-global'
export let beautylog = require("beautylog");
export import 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");
unzip: require('gulp-unzip'),
remoteSrc: require('gulp-remote-src')
}
export import gulp = require('gulp')
export import path = require('path')
export import smartfile = require('smartfile')
export import smartpath = require('smartpath')