-
-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update: Improve file structure & add semver version matching
- Loading branch information
Showing
21 changed files
with
117 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
'use strict'; | ||
|
||
var chalk = require('chalk'); | ||
var gutil = require('gulp-util'); | ||
var tildify = require('tildify'); | ||
|
||
var logTasks = require('./log/tasks'); | ||
var logEvents = require('./log/events'); | ||
var logTasksSimple = require('./log/tasksSimple'); | ||
|
||
function execute(opts, env) { | ||
|
||
var tasks = opts._; | ||
var toRun = tasks.length ? tasks : ['default']; | ||
|
||
// This is what actually loads up the gulpfile | ||
require(env.configPath); | ||
gutil.log('Using gulpfile', chalk.magenta(tildify(env.configPath))); | ||
|
||
var gulpInst = require(env.modulePath); | ||
logEvents(gulpInst); | ||
|
||
process.nextTick(function() { | ||
if (opts.tasksSimple) { | ||
return logTasksSimple(env, gulpInst); | ||
} | ||
if (opts.tasks) { | ||
return logTasks(env, gulpInst); | ||
} | ||
gulpInst.start.apply(gulpInst, toRun); | ||
}); | ||
} | ||
|
||
module.exports = execute; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
'use strict'; | ||
|
||
var chalk = require('chalk'); | ||
var gutil = require('gulp-util'); | ||
var tildify = require('tildify'); | ||
|
||
var exit = require('../../shared/exit'); | ||
|
||
var logTasks = require('./log/tasks'); | ||
var logEvents = require('./log/events'); | ||
var logTasksSimple = require('./log/tasksSimple'); | ||
|
||
function execute(opts, env) { | ||
|
||
var tasks = opts._; | ||
var toRun = tasks.length ? tasks : ['default']; | ||
|
||
var gulpInst = require(env.modulePath); | ||
logEvents(gulpInst); | ||
|
||
// This is what actually loads up the gulpfile | ||
require(env.configPath); | ||
|
||
process.nextTick(function() { | ||
if (opts.tasksSimple) { | ||
return logTasksSimple(gulpInst.tree()); | ||
} | ||
if (opts.tasks) { | ||
var tree = { | ||
label: 'Tasks for ' + chalk.magenta(tildify(env.configPath)), | ||
nodes: gulpInst.tree({ deep: true }), | ||
}; | ||
return logTasks(tree); | ||
} | ||
if (opts.tasksJson) { | ||
return console.log( | ||
JSON.stringify(gulpInst.tree({ deep: true }), null, 2) | ||
); | ||
} | ||
try { | ||
gutil.log('Using gulpfile', chalk.magenta(tildify(env.configPath))); | ||
// TODO: do we care about the error/result from calling this? | ||
gulpInst.parallel(toRun)(); | ||
} catch (err) { | ||
gutil.log(chalk.red(err.message)); | ||
gutil.log( | ||
'Please check the documentation for proper gulpfile formatting' | ||
); | ||
exit(1); | ||
} | ||
}); | ||
} | ||
|
||
module.exports = execute; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters