fix(core): update
This commit is contained in:
@ -1 +1 @@
|
||||
export * from './smartarchive.extract'
|
||||
export * from './smartarchive.classes.smartarchive';
|
||||
|
13
ts/smartarchive.classes.smartarchive.ts
Normal file
13
ts/smartarchive.classes.smartarchive.ts
Normal file
@ -0,0 +1,13 @@
|
||||
import * as plugins from './smartarchive.plugins';
|
||||
|
||||
export class SmartArchive {
|
||||
public archiveDirectory: string;
|
||||
constructor() {}
|
||||
|
||||
public extractArchiveFromFilePath(filePathArg: string, targetDir: string) {
|
||||
const parsedPath = plugins.path.parse(filePathArg);
|
||||
switch (parsedPath.ext) {
|
||||
|
||||
}
|
||||
};
|
||||
}
|
@ -1,26 +0,0 @@
|
||||
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
|
||||
};
|
||||
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.start.apply(plugins.gulp, [ 'default' ])
|
||||
}
|
4
ts/smartarchive.paths.ts
Normal file
4
ts/smartarchive.paths.ts
Normal file
@ -0,0 +1,4 @@
|
||||
import * as plugins from './smartarchive.plugins';
|
||||
|
||||
export const packageDir = plugins.path.join(__dirname, '../');
|
||||
export const nogitDir = plugins.path.join(__dirname, './.nogit');
|
@ -1,10 +1,15 @@
|
||||
import 'typings-global'
|
||||
export import beautylog = require('beautylog')
|
||||
export let g = {
|
||||
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')
|
||||
// node native scope
|
||||
import path from 'path';
|
||||
|
||||
export { path };
|
||||
|
||||
// @pushrocks scope
|
||||
import * as smartfile from '@pushrocks/smartfile';
|
||||
import * as smartpath from '@pushrocks/smartpath';
|
||||
|
||||
export { smartfile, smartpath };
|
||||
|
||||
// third party scope
|
||||
import tar from 'tar';
|
||||
|
||||
export { tar };
|
||||
|
Reference in New Issue
Block a user