Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ language: node_js
notifications:
email: false
node_js:
- '4'
- '12'
after_script:
- npm run coveralls
12 changes: 7 additions & 5 deletions examples/full.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ function html() {
);
}

gilp.hook('pre-commit', function() {
return gilp.srcFromStaged(['./app/**/*'])
gilp.hook('pre-commit', function(done) {
gilp.srcFromStaged(['./app/**/*'])
.pipe(js())
.pipe(py())
.pipe(html())
Expand All @@ -75,10 +75,12 @@ gilp.hook('pre-commit', function() {
}))
.pipe(mergeConflict())
.pipe(mergeConflict.failOnError());
done();
});

gilp.hook('commit-msg', function() {
return gilp.srcFromStaged(['**/*'])
gilp.hook('commit-msg', function(done) {
gilp.srcFromStaged(['**/*'])
.pipe(checkCommit(/^(NA|[0-9]+)\:\s[A-Z0-9].*\.$/gm, 'Invalid commit message format: Example > 4566: First letter in uppercase and end with a period.\n'
));
));
done();
});
8 changes: 4 additions & 4 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function Gilp (gulp) {
var gilp = this;
this._gulp = gulp;
this._installed = [];
this._gulp.task('gilp-install', function (callback) {
this._gulp.task('gilp-install', this._gulp.series(function (callback) {
var installed = gilp._installed.concat();
var saveNext = function (err) {
if (err) {
Expand All @@ -33,7 +33,7 @@ function Gilp (gulp) {
gilpUtil.installHook(hook, saveNext);
};
saveNext();
});
}));
}

Gilp.prototype.hook = function (name, dep, fn) {
Expand All @@ -46,10 +46,10 @@ Gilp.prototype.hook = function (name, dep, fn) {
dep = undefined;
}
dep = dep || [];
fn = fn || function () {};
fn = fn || function (done) { done(); };

this._installed.push(name);
this._gulp.task(util.format('gilp-%s', name), dep, fn);
this._gulp.task(util.format('gilp-%s', name), this._gulp.series(dep, fn));
};

Gilp.prototype._getStream = function (objectFormat, paths, glob, includeBOM) {
Expand Down
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gilp",
"version": "0.0.7",
"version": "0.0.8",
"description": "Gulp tasks for git hooks.",
"main": "lib/index.js",
"scripts": {
Expand Down Expand Up @@ -28,17 +28,17 @@
"homepage": "https://github.com/sophilabs/gilp#readme",
"dependencies": {
"gilp-util": "0.0.8",
"gulp-filter": "4.0.0",
"gulp-if": "2.0.2",
"gulp-filter": "6.0.0",
"gulp-if": "3.0.0",
"stream-array": "1.1.2",
"strip-bom-buf": "1.0.0",
"through2": "2.0.1",
"vinyl": "2.0.0"
"strip-bom-buf": "2.0.0",
"through2": "3.0.1",
"vinyl": "2.2.0"
},
"devDependencies": {
"coveralls": "2.11.9",
"istanbul": "0.4.4",
"mocha": "2.5.3",
"semistandard": "8.0.0"
"coveralls": "3.0.9",
"istanbul": "0.4.5",
"mocha": "7.0.1",
"semistandard": "14.2.0"
}
}
Loading