Compare commits
12 Commits
Author | SHA1 | Date | |
---|---|---|---|
141a1339c0 | |||
00bfb6535a | |||
3fe1a78bd9 | |||
a602c68d8b | |||
13c82ce689 | |||
fad9848fef | |||
889ef2d31c | |||
2f4f325a86 | |||
7a00a44a70 | |||
f5f12c6fa1 | |||
eb2b068870 | |||
666e615b5a |
9
.gitignore
vendored
9
.gitignore
vendored
@ -1,5 +1,4 @@
|
||||
.idea/
|
||||
ts/*.js
|
||||
ts/*.js.map
|
||||
node_modules
|
||||
test/
|
||||
coverage/
|
||||
node_modules/
|
||||
public/
|
||||
pages/
|
||||
|
71
.gitlab-ci.yml
Normal file
71
.gitlab-ci.yml
Normal file
@ -0,0 +1,71 @@
|
||||
# gitzone standard
|
||||
image: hosttoday/ht-docker-node:npmci
|
||||
|
||||
cache:
|
||||
paths:
|
||||
- .yarn/
|
||||
key: "$CI_BUILD_STAGE"
|
||||
|
||||
stages:
|
||||
- test
|
||||
- release
|
||||
- trigger
|
||||
- pages
|
||||
|
||||
testLEGACY:
|
||||
stage: test
|
||||
script:
|
||||
- npmci test legacy
|
||||
coverage: /\d+.?\d+?\%\s*coverage/
|
||||
tags:
|
||||
- docker
|
||||
allow_failure: true
|
||||
|
||||
testLTS:
|
||||
stage: test
|
||||
script:
|
||||
- npmci test lts
|
||||
coverage: /\d+.?\d+?\%\s*coverage/
|
||||
tags:
|
||||
- docker
|
||||
|
||||
testSTABLE:
|
||||
stage: test
|
||||
script:
|
||||
- npmci test stable
|
||||
coverage: /\d+.?\d+?\%\s*coverage/
|
||||
tags:
|
||||
- docker
|
||||
|
||||
release:
|
||||
stage: release
|
||||
script:
|
||||
- npmci publish
|
||||
only:
|
||||
- tags
|
||||
tags:
|
||||
- docker
|
||||
|
||||
trigger:
|
||||
stage: trigger
|
||||
script:
|
||||
- npmci trigger
|
||||
only:
|
||||
- tags
|
||||
tags:
|
||||
- docker
|
||||
|
||||
pages:
|
||||
image: hosttoday/ht-docker-node:npmci
|
||||
stage: pages
|
||||
script:
|
||||
- npmci command yarn global add npmpage
|
||||
- npmci command npmpage --publish gitlab
|
||||
tags:
|
||||
- docker
|
||||
only:
|
||||
- tags
|
||||
artifacts:
|
||||
expire_in: 1 week
|
||||
paths:
|
||||
- public
|
@ -1,5 +0,0 @@
|
||||
.idea/
|
||||
ts/*.js
|
||||
ts/*.js.map
|
||||
node_modules
|
||||
test/
|
11
.travis.yml
11
.travis.yml
@ -1,11 +0,0 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- 4.2.4
|
||||
deploy:
|
||||
provider: npm
|
||||
email: npm@lossless.digital
|
||||
api_key:
|
||||
secure: JNfCkELIH8XfYpK6KMwT3p8lT6LWWzpFwTdD1CY6KYKYBL5F3JtaNrVA/5qtXR3QtxQ71pMDuMMTpAUWkcK4/faZn/ZIavsi5b1bXGSwqSez6p70d5Ob4prxvFnjAGUZ0zbfIxhmpMCfFiYLoAYyNAcnlqqKaNI+ARrTFApVuihrpaJj6DyChVY5VbzqIoErDiMYO+BxqPvqzfqabtanCJo2LVgCdZ2RuNMSEUqkn/J9fJoy6+MpgMrNIm/S6e+sCt9VVqVqfxy89SYBc2rmTVaaMlhy6AMbRPVhLqLBn/u4303/5MZlPsAWcyL03GNv3UC1WPaNbA/FNcK3Hxp++p+2hTu/BPes7WWD6/GLilbjt12dRaRlSojlU8BpNd/IzSEnnwFvl68XFoOjaF97lHqoh4W9eeF5Yjd1IcKk2A5ZMS8G/MTblPHDU5AoEKAjTZgf9ntC9iWfEEZYbVuwHcHUONkGfYuTe/nCxRaiCbnUyyEG3I5Gf2+bUyEQSl69pnlhCEDPmD0c+KOz9UPlW833iJ3dQboTcF3TF05nW/YFtLFF5IVgXss+QsBAtuDVj4OJ56b4WJyrFCjr5GgGPI4GjCpDVt8MU1yWRpRycJssKtxAdH5o4WdVPLqIIhf1NJP9xemTaXIQ6EzymxzXKyh9ynp58k+ojUUYb722i7Q=
|
||||
on:
|
||||
tags: true
|
||||
repo: pushrocks/remotezip
|
37
README.md
Normal file
37
README.md
Normal file
@ -0,0 +1,37 @@
|
||||
# smartarchive
|
||||
work with archives
|
||||
|
||||
## Availabililty
|
||||
[](https://www.npmjs.com/package/smartarchive)
|
||||
[](https://GitLab.com/pushrocks/smartarchive)
|
||||
[](https://github.com/pushrocks/smartarchive)
|
||||
[](https://pushrocks.gitlab.io/smartarchive/)
|
||||
|
||||
## Status for master
|
||||
[](https://GitLab.com/pushrocks/smartarchive/commits/master)
|
||||
[](https://GitLab.com/pushrocks/smartarchive/commits/master)
|
||||
[](https://www.npmjs.com/package/smartarchive)
|
||||
[](https://david-dm.org/pushrocks/smartarchive)
|
||||
[](https://www.bithound.io/github/pushrocks/smartarchive/master/dependencies/npm)
|
||||
[](https://www.bithound.io/github/pushrocks/smartarchive)
|
||||
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
||||
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
||||
[](http://standardjs.com/)
|
||||
|
||||
## Usage
|
||||
Use TypeScript for best in class instellisense.
|
||||
|
||||
```javascript
|
||||
import * as smartarchive from 'smartarchive'
|
||||
smartarchive.get({
|
||||
from:"https://example.com/example.zip",
|
||||
toPath:"/some/local/absolute/path",
|
||||
}).then(/*...*/)
|
||||
```
|
||||
|
||||
For further information read the linked docs at the top of this README.
|
||||
|
||||
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
||||
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
|
||||
|
||||
[](https://push.rocks)
|
1
dist/index.d.ts
vendored
Normal file
1
dist/index.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
||||
export * from './smartarchive.extract';
|
7
dist/index.js
vendored
Normal file
7
dist/index.js
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
"use strict";
|
||||
function __export(m) {
|
||||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
||||
}
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
__export(require("./smartarchive.extract"));
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUFBLDRDQUFzQyJ9
|
5
dist/smartarchive.extract.d.ts
vendored
Normal file
5
dist/smartarchive.extract.d.ts
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
export declare let toFS: (options: {
|
||||
from: string;
|
||||
toPath: string;
|
||||
cb?: any;
|
||||
}) => void;
|
0
dist/smartarchive.extract.helpers.d.ts
vendored
Normal file
0
dist/smartarchive.extract.helpers.d.ts
vendored
Normal file
1
dist/smartarchive.extract.helpers.js
vendored
Normal file
1
dist/smartarchive.extract.helpers.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRhcmNoaXZlLmV4dHJhY3QuaGVscGVycy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3NtYXJ0YXJjaGl2ZS5leHRyYWN0LmhlbHBlcnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiJ9
|
28
dist/smartarchive.extract.js
vendored
Normal file
28
dist/smartarchive.extract.js
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const plugins = require("./smartarchive.plugins");
|
||||
exports.toFS = function (options) {
|
||||
if (!plugins.path.isAbsolute(options.toPath)) {
|
||||
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']);
|
||||
};
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRhcmNoaXZlLmV4dHJhY3QuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9zbWFydGFyY2hpdmUuZXh0cmFjdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLGtEQUFrRDtBQUN2QyxRQUFBLElBQUksR0FBRyxVQUFVLE9BQTZDO0lBRXZFLEVBQUUsQ0FBQyxDQUFDLENBQUMsT0FBTyxDQUFDLElBQUksQ0FBQyxVQUFVLENBQUMsT0FBTyxDQUFDLE1BQU0sQ0FBQyxDQUFDLENBQUMsQ0FBQztRQUM3QyxPQUFPLENBQUMsU0FBUyxDQUFDLEtBQUssQ0FBQywrQ0FBK0MsQ0FBQyxDQUFBO1FBQ3hFLE1BQU0sQ0FBQTtJQUNSLENBQUM7SUFBQSxDQUFDO0lBQ0YsT0FBTyxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsV0FBVyxFQUFFO1FBQzdCLE9BQU8sQ0FBQyxTQUFTLENBQUMsR0FBRyxDQUFDLHVDQUF1QyxDQUFDLENBQUE7UUFDOUQsSUFBSSxNQUFNLEdBQUcsT0FBTyxDQUFDLENBQUMsQ0FBQyxTQUFTLENBQUMsQ0FBRSxZQUFZLENBQUUsRUFBRTtZQUNqRCxJQUFJLEVBQUUsb0RBQW9EO1NBQzNELENBQUM7YUFDQyxJQUFJLENBQUMsT0FBTyxDQUFDLENBQUMsQ0FBQyxLQUFLLEVBQUUsQ0FBQzthQUN2QixJQUFJLENBQUMsT0FBTyxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFDLE1BQU0sQ0FBQyxDQUFDLENBQUE7UUFDMUMsTUFBTSxDQUFDLE1BQU0sQ0FBQTtJQUNmLENBQUMsQ0FBQyxDQUFBO0lBRUYsT0FBTyxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsU0FBUyxFQUFFLENBQUUsV0FBVyxDQUFFLEVBQUU7UUFDNUMsT0FBTyxDQUFDLFNBQVMsQ0FBQyxPQUFPLENBQUMseUNBQXlDLENBQUMsQ0FBQTtRQUNwRSxFQUFFLENBQUMsQ0FBQyxPQUFPLE9BQU8sQ0FBQyxFQUFFLEtBQUssVUFBVSxDQUFDLENBQUMsQ0FBQztZQUNyQyxPQUFPLENBQUMsRUFBRSxFQUFFLENBQUE7UUFDZCxDQUFDO1FBQUEsQ0FBQztJQUNKLENBQUMsQ0FBQyxDQUFBO0lBRUYsT0FBTyxDQUFDLElBQUksQ0FBQyxLQUFLLENBQUMsS0FBSyxDQUFDLE9BQU8sQ0FBQyxJQUFJLEVBQUUsQ0FBRSxTQUFTLENBQUUsQ0FBQyxDQUFBO0FBQ3ZELENBQUMsQ0FBQSJ9
|
10
dist/smartarchive.plugins.d.ts
vendored
Normal file
10
dist/smartarchive.plugins.d.ts
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
import 'typings-global';
|
||||
export import beautylog = require('beautylog');
|
||||
export declare let g: {
|
||||
unzip: any;
|
||||
remoteSrc: any;
|
||||
};
|
||||
export import gulp = require('gulp');
|
||||
export import path = require('path');
|
||||
export import smartfile = require('smartfile');
|
||||
export import smartpath = require('smartpath');
|
13
dist/smartarchive.plugins.js
vendored
Normal file
13
dist/smartarchive.plugins.js
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
require("typings-global");
|
||||
exports.beautylog = require("beautylog");
|
||||
exports.g = {
|
||||
unzip: require('gulp-unzip'),
|
||||
remoteSrc: require('gulp-remote-src')
|
||||
};
|
||||
exports.gulp = require("gulp");
|
||||
exports.path = require("path");
|
||||
exports.smartfile = require("smartfile");
|
||||
exports.smartpath = require("smartpath");
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRhcmNoaXZlLnBsdWdpbnMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9zbWFydGFyY2hpdmUucGx1Z2lucy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLDBCQUF1QjtBQUN2Qix5Q0FBOEM7QUFDbkMsUUFBQSxDQUFDLEdBQUc7SUFDWCxLQUFLLEVBQUUsT0FBTyxDQUFDLFlBQVksQ0FBQztJQUM1QixTQUFTLEVBQUUsT0FBTyxDQUFDLGlCQUFpQixDQUFDO0NBQ3hDLENBQUE7QUFDRCwrQkFBb0M7QUFDcEMsK0JBQW9DO0FBQ3BDLHlDQUE4QztBQUM5Qyx5Q0FBOEMifQ==
|
25
index.d.ts
vendored
25
index.d.ts
vendored
@ -1,25 +0,0 @@
|
||||
/// <reference path="ts/typings/tsd.d.ts" />
|
||||
declare module RemotezipPlugins {
|
||||
var init: () => {
|
||||
beautylog: any;
|
||||
gulp: any;
|
||||
g: {
|
||||
unzip: any;
|
||||
remoteSrc: any;
|
||||
};
|
||||
path: any;
|
||||
};
|
||||
}
|
||||
declare var plugins: {
|
||||
beautylog: any;
|
||||
gulp: any;
|
||||
g: {
|
||||
unzip: any;
|
||||
remoteSrc: any;
|
||||
};
|
||||
path: any;
|
||||
};
|
||||
declare var remotezip: (options: {
|
||||
from: string;
|
||||
toPath: string;
|
||||
}) => void;
|
39
index.js
39
index.js
@ -1,39 +0,0 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
/// <reference path="./index.ts" />
|
||||
var RemotezipPlugins;
|
||||
(function (RemotezipPlugins) {
|
||||
RemotezipPlugins.init = function () {
|
||||
var plugins = {
|
||||
beautylog: require("beautylog"),
|
||||
gulp: require("gulp"),
|
||||
g: {
|
||||
unzip: require("gulp-unzip"),
|
||||
remoteSrc: require("gulp-remote-src")
|
||||
},
|
||||
path: require("path")
|
||||
};
|
||||
return plugins;
|
||||
};
|
||||
})(RemotezipPlugins || (RemotezipPlugins = {}));
|
||||
/// <reference path="./typings/tsd.d.ts" />
|
||||
/// <reference path="./remotezip.plugins.ts" />
|
||||
var plugins = RemotezipPlugins.init();
|
||||
var remotezip = function (options) {
|
||||
if (!plugins.path.isAbsolute(options.toPath)) {
|
||||
plugins.beautylog.error("Please supply remotezip with an absolute path");
|
||||
return;
|
||||
}
|
||||
;
|
||||
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;
|
||||
});
|
||||
plugins.gulp.start.apply(plugins.gulp, ['default']);
|
||||
};
|
||||
module.exports = remotezip;
|
7
npmextra.json
Normal file
7
npmextra.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"npmci": {
|
||||
"globalNpmTools": [
|
||||
"npmts"
|
||||
]
|
||||
}
|
||||
}
|
33
package.json
33
package.json
@ -1,30 +1,31 @@
|
||||
{
|
||||
"name": "remotezip",
|
||||
"version": "1.0.0",
|
||||
"description": "work with remote zip files",
|
||||
"main": "index.js",
|
||||
"name": "smartarchive",
|
||||
"version": "1.0.4",
|
||||
"description": "work with archives",
|
||||
"main": "dist/index.js",
|
||||
"typings": "dist/index.d.ts",
|
||||
"scripts": {
|
||||
"test": "(npmts)",
|
||||
"testm": "(npm test) && (node test.js)"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/pushrocks/remotezip.git"
|
||||
"url": "git+https://github.com/pushrocks/smartarchive.git"
|
||||
},
|
||||
"author": "Lossless Digital UG (haftungsbeschraenkt)",
|
||||
"author": "Lossless GmbH",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/pushrocks/remotezip/issues"
|
||||
"url": "https://github.com/pushrocks/smartarchive/issues"
|
||||
},
|
||||
"homepage": "https://github.com/pushrocks/remotezip#readme",
|
||||
"homepage": "https://github.com/pushrocks/smartarchive#readme",
|
||||
"dependencies": {
|
||||
"beautylog": "^2.0.2",
|
||||
"gulp": "^3.9.0",
|
||||
"gulp-remote-src": "^0.4.0",
|
||||
"gulp-unzip": "^0.1.3",
|
||||
"remotefile": "0.0.14"
|
||||
"@types/gulp": "^4.0.0",
|
||||
"beautylog": "^6.1.5",
|
||||
"gulp": "^3.9.1",
|
||||
"gulp-remote-src": "^0.4.2",
|
||||
"gulp-unzip": "^0.2.0",
|
||||
"smartfile": "^4.1.8",
|
||||
"smartpath": "^3.2.8"
|
||||
},
|
||||
"devDependencies": {
|
||||
"npmts": "1.0.9"
|
||||
}
|
||||
"devDependencies": {}
|
||||
}
|
||||
|
8
test.js
8
test.js
@ -1,4 +1,10 @@
|
||||
/// <reference path="./typings/tsd.d.ts" />
|
||||
var remotezip = require("./index.js");
|
||||
var path = require("path");
|
||||
remotezip({ from: "https://github.com/UmbrellaZone/legaldocs/archive/master.zip", toPath: path.resolve("./test/") });
|
||||
remotezip.get({
|
||||
from: "https://github.com/UmbrellaZone/legaldocs/archive/master.zip",
|
||||
toPath: path.resolve("./test/"),
|
||||
cb: function () {
|
||||
console.log("This is a callback");
|
||||
}
|
||||
});
|
||||
|
0
test/test.d.ts
vendored
Normal file
0
test/test.d.ts
vendored
Normal file
1
test/test.js
Normal file
1
test/test.js
Normal file
@ -0,0 +1 @@
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiJ9
|
1
test/test.js.map
Normal file
1
test/test.js.map
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,IAAI,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;AACzC,IAAI,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAE3B,YAAY,CAAC,GAAG,CAAC;IACb,IAAI,EAAC,8DAA8D;IACnE,MAAM,EAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC;IAC9B,EAAE,EAAE;QACA,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAA;IACrC,CAAC;CACJ,CAAC,CAAC"}
|
0
test/test.ts
Normal file
0
test/test.ts
Normal file
27
ts/index.ts
27
ts/index.ts
@ -1,26 +1 @@
|
||||
/// <reference path="./typings/tsd.d.ts" />
|
||||
/// <reference path="./remotezip.plugins.ts" />
|
||||
|
||||
var plugins = RemotezipPlugins.init();
|
||||
|
||||
var remotezip = function(options:{from:string,toPath:string}){
|
||||
|
||||
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('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;
|
||||
});
|
||||
|
||||
plugins.gulp.start.apply(plugins.gulp, ['default']);
|
||||
};
|
||||
|
||||
module.exports = remotezip;
|
||||
export * from './smartarchive.extract'
|
||||
|
@ -1,15 +0,0 @@
|
||||
/// <reference path="./index.ts" />
|
||||
module RemotezipPlugins {
|
||||
export var init = function() {
|
||||
var plugins = {
|
||||
beautylog: require("beautylog"),
|
||||
gulp: require("gulp"),
|
||||
g:{
|
||||
unzip: require("gulp-unzip"),
|
||||
remoteSrc: require("gulp-remote-src")
|
||||
},
|
||||
path: require("path")
|
||||
};
|
||||
return plugins;
|
||||
}
|
||||
}
|
0
ts/smartarchive.extract.helpers.ts
Normal file
0
ts/smartarchive.extract.helpers.ts
Normal file
26
ts/smartarchive.extract.ts
Normal file
26
ts/smartarchive.extract.ts
Normal file
@ -0,0 +1,26 @@
|
||||
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' ])
|
||||
}
|
10
ts/smartarchive.plugins.ts
Normal file
10
ts/smartarchive.plugins.ts
Normal file
@ -0,0 +1,10 @@
|
||||
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')
|
@ -1,4 +0,0 @@
|
||||
/// <reference path="./typings/tsd.d.ts" />
|
||||
var remotezip = require("./index.js");
|
||||
var path = require("path");
|
||||
remotezip({from:"https://github.com/UmbrellaZone/legaldocs/archive/master.zip",toPath:path.resolve("./test/")});
|
12
ts/tsd.json
12
ts/tsd.json
@ -1,12 +0,0 @@
|
||||
{
|
||||
"version": "v4",
|
||||
"repo": "borisyankov/DefinitelyTyped",
|
||||
"ref": "master",
|
||||
"path": "typings",
|
||||
"bundle": "typings/tsd.d.ts",
|
||||
"installed": {
|
||||
"node/node.d.ts": {
|
||||
"commit": "efa0c1196d7280640e624ac1e7fa604502e7bd63"
|
||||
}
|
||||
}
|
||||
}
|
2079
ts/typings/node/node.d.ts
vendored
2079
ts/typings/node/node.d.ts
vendored
File diff suppressed because it is too large
Load Diff
1
ts/typings/tsd.d.ts
vendored
1
ts/typings/tsd.d.ts
vendored
@ -1 +0,0 @@
|
||||
/// <reference path="node/node.d.ts" />
|
3
tslint.json
Normal file
3
tslint.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "tslint-config-standard"
|
||||
}
|
Reference in New Issue
Block a user