Skip to content

Commit f7abe80

Browse files
author
benholloway
committed
allowed direct command line invocation without gulp keyword
1 parent ba5c8ed commit f7abe80

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

bin/gulp-es6-modular.js

Lines changed: 0 additions & 4 deletions
This file was deleted.

index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ function hr(char, length, title) {
138138

139139
// DEFAULT ---------------------------------
140140
var isMinify = (process.argv[process.argv.length - 1] !== 'nominify');
141+
var taskName = process.argv[process.argv.length - 1 - Number(!isMinify)];
141142

142143
gulp.task('default', [ 'watch' ]);
143144

@@ -418,4 +419,7 @@ gulp.task('watch', [ 'server' ], function() {
418419
}, queue.getHandler('html', 'reload'));
419420
});
420421

421-
module.exports = gulp;
422+
// KICKOFF ---------------------------------
423+
if (process.argv.indexOf('gulp') < 0) {
424+
gulp.start(gulp.hasTask(taskName) ? taskName : 'default');
425+
}

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
"description": "Gulpfile for building Angular ES6 and SASS from local and bower sources",
44
"version": "0.0.8",
55
"main": "index.js",
6+
"bin": {
7+
"gulp-es6-modular": "index.js"
8+
},
69
"repository": {
710
"type": "git",
811
"url": "https://github.com/bholloway/gulp-es6-modular"

0 commit comments

Comments
 (0)