fixes #3 and removes beautylog dependency
This commit is contained in:
parent
f094f80531
commit
bb607eca9b
12
README.md
12
README.md
@ -38,6 +38,14 @@ gulp.task('gulpTest',function() {
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
> Note: The first argument of gulpFunction can also be an array of multiple functionnames.
|
### Notes:
|
||||||
|
|
||||||
|
* The first argument of gulpFunction can also be an **array of multiple functionnames**.
|
||||||
Each function can return a promise. the pipe stop will finish when every promise is fullfilled.
|
Each function can return a promise. the pipe stop will finish when every promise is fullfilled.
|
||||||
> Note: the second argument can be empty, "forEach" (default), "forFirst" or "atEnd";
|
* the second argument can be empty, it defaults to "forEach"
|
||||||
|
* the following options are available:
|
||||||
|
* "forFirst" - executes when first chunk/vinylfile of the stream reaches the pipestop.
|
||||||
|
file is pushed further down the line when function's returned promise is fullfilled.
|
||||||
|
* "atEnd" - executes like "forFirst" but with every chunk/vinylfile in the stream;
|
||||||
|
* "atLast" - executes after all chunks have passed and are processed in full.
|
||||||
|
That means the stream's "finish" event fires before "atLast" is executed!!!
|
6
dist/gulpfunction.plugins.js
vendored
Normal file
6
dist/gulpfunction.plugins.js
vendored
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
/// <reference path="typings/main.d.ts" />
|
||||||
|
"use strict";
|
||||||
|
exports.Q = require("q");
|
||||||
|
exports.through2 = require("through2");
|
||||||
|
|
||||||
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImd1bHBmdW5jdGlvbi5wbHVnaW5zLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLDBDQUEwQzs7QUFFL0IsU0FBQyxHQUFHLE9BQU8sQ0FBQyxHQUFHLENBQUMsQ0FBQztBQUNqQixnQkFBUSxHQUFHLE9BQU8sQ0FBQyxVQUFVLENBQUMsQ0FBQyIsImZpbGUiOiJndWxwZnVuY3Rpb24ucGx1Z2lucy5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8vLyA8cmVmZXJlbmNlIHBhdGg9XCJ0eXBpbmdzL21haW4uZC50c1wiIC8+XG5cbmV4cG9ydCBsZXQgUSA9IHJlcXVpcmUoXCJxXCIpO1xuZXhwb3J0IGxldCB0aHJvdWdoMiA9IHJlcXVpcmUoXCJ0aHJvdWdoMlwiKTtcbiJdLCJzb3VyY2VSb290IjoiL3NvdXJjZS8ifQ==
|
13
dist/index.js
vendored
13
dist/index.js
vendored
File diff suppressed because one or more lines are too long
4
ts/gulpfunction.plugins.ts
Normal file
4
ts/gulpfunction.plugins.ts
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
/// <reference path="typings/main.d.ts" />
|
||||||
|
|
||||||
|
export let Q = require("q");
|
||||||
|
export let through2 = require("through2");
|
10
ts/index.ts
10
ts/index.ts
@ -1,10 +1,6 @@
|
|||||||
/// <reference path="typings/main.d.ts" />
|
/// <reference path="typings/main.d.ts" />
|
||||||
|
|
||||||
var plugins = {
|
import plugins = require("./gulpfunction.plugins");
|
||||||
beautylog: require("beautylog"),
|
|
||||||
Q: require("q"),
|
|
||||||
through: require("through2")
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -29,7 +25,7 @@ module.exports = function (functionsToExecuteArg:any|any[],executionModeArg:stri
|
|||||||
runFunction(functionsToExecute[anyFunction]);
|
runFunction(functionsToExecute[anyFunction]);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
plugins.beautylog.error('gulp-callfunction: something is strange with the given arguments');
|
throw new Error("gulp-callfunction: something is strange with the given arguments");
|
||||||
}
|
}
|
||||||
return plugins.Q.all(promiseArray);
|
return plugins.Q.all(promiseArray);
|
||||||
};
|
};
|
||||||
@ -65,5 +61,5 @@ module.exports = function (functionsToExecuteArg:any|any[],executionModeArg:stri
|
|||||||
cb();
|
cb();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
return plugins.through.obj(forEach,atEnd);
|
return plugins.through2.obj(forEach,atEnd);
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user