Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
e0c4a10411 | |||
6deab0541f | |||
22e3dc6136 | |||
e69e8df875 | |||
4cb24a4a6d |
@ -4,6 +4,7 @@ accepts call to execute in gulp pipeline.
|
|||||||
### build status/Dependencies
|
### build status/Dependencies
|
||||||
[](https://travis-ci.org/pushrocks/gulp-callfunction)
|
[](https://travis-ci.org/pushrocks/gulp-callfunction)
|
||||||
[](https://david-dm.org/pushrocks/gulp-callfunction)
|
[](https://david-dm.org/pushrocks/gulp-callfunction)
|
||||||
|
[](https://david-dm.org/pushrocks/gulp-callfunction#info=devDependencies)
|
||||||
|
|
||||||
### Usage
|
### Usage
|
||||||
```javascript
|
```javascript
|
||||||
|
5
index.js
5
index.js
@ -1,7 +1,7 @@
|
|||||||
/// <reference path="typings/tsd.d.ts" />
|
/// <reference path="typings/tsd.d.ts" />
|
||||||
var through = require("through2");
|
var through = require("through2");
|
||||||
var path = require("path");
|
var path = require("path");
|
||||||
var beautylog = require("beautylog");
|
var beautylog = require("beautylog")("os");
|
||||||
//important vars
|
//important vars
|
||||||
var gulpCallFunction = {
|
var gulpCallFunction = {
|
||||||
executionMode: 'forEach',
|
executionMode: 'forEach',
|
||||||
@ -32,10 +32,11 @@ var forEach = function (file, enc, cb) {
|
|||||||
//tell gulp that we are complete
|
//tell gulp that we are complete
|
||||||
return cb(null, file);
|
return cb(null, file);
|
||||||
};
|
};
|
||||||
var atEnd = function () {
|
var atEnd = function (cb) {
|
||||||
if (gulpCallFunction.executionMode == "atEnd") {
|
if (gulpCallFunction.executionMode == "atEnd") {
|
||||||
runFunctionNames();
|
runFunctionNames();
|
||||||
}
|
}
|
||||||
|
cb();
|
||||||
};
|
};
|
||||||
module.exports = function (functionsToExecute, executionMode, logBool) {
|
module.exports = function (functionsToExecute, executionMode, logBool) {
|
||||||
if (executionMode === void 0) { executionMode = 'forEach'; }
|
if (executionMode === void 0) { executionMode = 'forEach'; }
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "gulp-callfunction",
|
"name": "gulp-callfunction",
|
||||||
"version": "0.0.7",
|
"version": "0.0.9",
|
||||||
"description": "accepts a function call as parameter to execute in gulp pipeline",
|
"description": "accepts a function call as parameter to execute in gulp pipeline",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@ -29,7 +29,7 @@
|
|||||||
"gulp-typescript": "^2.9.2"
|
"gulp-typescript": "^2.9.2"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"beautylog": "0.0.15",
|
"beautylog": "1.0.4",
|
||||||
"through2": "^2.0.0"
|
"through2": "^2.0.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
3
test.js
3
test.js
@ -1,8 +1,9 @@
|
|||||||
/// <reference path="typings/tsd.d.ts" />
|
/// <reference path="typings/tsd.d.ts" />
|
||||||
var gulp = require("gulp");
|
var gulp = require("gulp");
|
||||||
var gulpCallFunction = require("./index.js");
|
var gulpCallFunction = require("./index.js");
|
||||||
|
var beautylog = require("beautylog")("os");
|
||||||
var myFunction = function () {
|
var myFunction = function () {
|
||||||
console.log("Hello World!");
|
beautylog.log("Hello World!");
|
||||||
};
|
};
|
||||||
gulp.task('default', function () {
|
gulp.task('default', function () {
|
||||||
gulp.src('./test/test.md')
|
gulp.src('./test/test.md')
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/// <reference path="typings/tsd.d.ts" />
|
/// <reference path="typings/tsd.d.ts" />
|
||||||
var through = require("through2");
|
var through = require("through2");
|
||||||
var path = require("path");
|
var path = require("path");
|
||||||
var beautylog = require("beautylog");
|
var beautylog = require("beautylog")("os");
|
||||||
|
|
||||||
//important vars
|
//important vars
|
||||||
var gulpCallFunction = {
|
var gulpCallFunction = {
|
||||||
@ -33,10 +33,11 @@ var forEach = function (file, enc, cb) {
|
|||||||
return cb(null, file);
|
return cb(null, file);
|
||||||
};
|
};
|
||||||
|
|
||||||
var atEnd = function() {
|
var atEnd = function(cb) {
|
||||||
if (gulpCallFunction.executionMode == "atEnd") {
|
if (gulpCallFunction.executionMode == "atEnd") {
|
||||||
runFunctionNames();
|
runFunctionNames();
|
||||||
}
|
}
|
||||||
|
cb();
|
||||||
};
|
};
|
||||||
module.exports = function (functionsToExecute:any|any[],executionMode:string = 'forEach', logBool = false) {
|
module.exports = function (functionsToExecute:any|any[],executionMode:string = 'forEach', logBool = false) {
|
||||||
gulpCallFunction.functionsToExecute = functionsToExecute;
|
gulpCallFunction.functionsToExecute = functionsToExecute;
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
/// <reference path="typings/tsd.d.ts" />
|
/// <reference path="typings/tsd.d.ts" />
|
||||||
var gulp = require("gulp");
|
var gulp = require("gulp");
|
||||||
var gulpCallFunction = require("./index.js");
|
var gulpCallFunction = require("./index.js");
|
||||||
|
var beautylog = require("beautylog")("os");
|
||||||
|
|
||||||
var myFunction = function () {
|
var myFunction = function () {
|
||||||
console.log("Hello World!");
|
beautylog.log("Hello World!");
|
||||||
}
|
}
|
||||||
|
|
||||||
gulp.task('default',function() {
|
gulp.task('default',function() {
|
||||||
|
Reference in New Issue
Block a user