Skip to content

Commit

Permalink
Merge e6d6955 into 1486626
Browse files Browse the repository at this point in the history
  • Loading branch information
cdiaz-sophilabs committed Feb 10, 2020
2 parents 1486626 + e6d6955 commit 4c422f2
Show file tree
Hide file tree
Showing 5 changed files with 2,778 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
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
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
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
@@ -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"
}
}

0 comments on commit 4c422f2

Please sign in to comment.