Skip to content

Commit

Permalink
style changes to bin
Browse files Browse the repository at this point in the history
  • Loading branch information
Contra committed Oct 30, 2013
1 parent 639bbda commit 1881df4
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 17 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ build
components
*.orig
.idea
sandbox
4 changes: 3 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
node_modules
build
*.node
components
components
sandbox
.idea
32 changes: 17 additions & 15 deletions bin/gulp
Original file line number Diff line number Diff line change
@@ -1,33 +1,35 @@
#!/usr/bin/env node

var gulp = require('../'),
argv = require('optimist').argv,
join = require('path').join,
existsSync = require('fs').existsSync,
tasks = argv._,
gulpFilename = getGulpFile();
var path = require('path');
var fs = require('fs');

var argv = require('optimist').argv;

var gulp = require('../');
var gulpFilename = getGulpFile();
var tasks = argv._;

if (!gulpFilename) {
throw new Error("Missing Gulpfile");
}

// Expose list of tasks and flags to other tasks
gulp.env = argv;
// Expose CLI flags to tasks or plugins
gulp.env = tasks;

var theGulpfile = require(gulpFilename);

gulp.run.apply(gulp, tasks);

function getGulpFile() {
var Gulpfiles = Object.keys(require.extensions).map(function(ext){
return join(process.cwd(), "Gulpfile" + ext);
var extensions = Object.keys(require.extensions);
var Gulpfiles = extensions.map(function(ext){
return path.join(process.cwd(), "Gulpfile" + ext);
});

var gulpFiles = Object.keys(require.extensions).map(function(ext){
return join(process.cwd(), "gulpfile" + ext);
var gulpFiles = extensions.map(function(ext){
return path.join(process.cwd(), "gulpfile" + ext);
});

return gulpFiles.concat(Gulpfiles).filter(function(v){
return existsSync(v);
})[0];
return gulpFiles.concat(Gulpfiles)
.filter(fs.existsSync)[0];
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name":"gulp",
"description":"The streaming build system",
"version":"1.2.0",
"version":"1.2.1",
"homepage":"http://github.com/wearefractal/gulp",
"repository":"git://github.com/wearefractal/gulp.git",
"author":"Fractal <[email protected]> (http://wearefractal.com/)",
Expand Down

0 comments on commit 1881df4

Please sign in to comment.