Permalink
Browse files

Cleanup after merge of coffescript support.

  • Loading branch information...
1 parent cab225e commit b1ead4d393ac04b70fd8807820e36ffb11b618b5 @mde mde committed Oct 10, 2010
Showing with 8 additions and 38 deletions.
  1. +0 −27 README.markdown
  2. +8 −11 lib/jake.js
View
@@ -113,33 +113,6 @@ Here's an example:
In this example, the foo:baz task depends on both the default and the foo:bar task.
-
-Use `invoke` to run any task in the middle of running another task. Call it with two arguments:
-
- invoke(name, args);
-
-Where is `name` is the name of the task (with namespace ex. 'foo:baz'), and `args` is a array of arguments for task.
-
-Here's an example:
-
- var sys = require('sys');
-
- desc('This is the default task.');
- task('default', [], function () {
- sys.puts('This is the default task.');
- sys.puts(sys.inspect(arguments));
- invoke('foo:bar', ['param'])
- });
-
- namespace('foo', function () {
- desc('This the foo:bar task');
- task('bar', [], function (param) {
- sys.puts('doing foo:bar task with param: ' + param);
- sys.puts(sys.inspect(arguments));
- });
- });
-
-
### Passing parameters to jake
Two kinds of parameters can be passed to Jake: positional and named parameters.
View
@@ -371,13 +371,6 @@ global.complete = function () {
jake.runNextTask();
};
-global.invoke = function(name, args) {
- if (!args) {
- throw new Error('Missing args in invoke of task "' + name + '".');
- }
- jake.runTask(name, args);
-};
-
// ========================
// Run Jake
// ========================
@@ -406,6 +399,9 @@ var cmds = Parser.cmds;
var taskName = cmds.shift();
var jakefile;
var dirname = opts.directory || process.cwd();
+var isCoffee;
+var exists;
+var tasks;
taskName = taskName || 'default';
@@ -423,8 +419,8 @@ if (typeof opts.version != 'undefined') {
jake.die(JAKE_VERSION);
}
-var isCoffee = path.existsSync(jakefile + '.coffee');
-var exists = path.existsSync(jakefile) || path.existsSync(jakefile + '.js') || isCoffee;
+isCoffee = path.existsSync(jakefile + '.coffee');
+exists = path.existsSync(jakefile) || path.existsSync(jakefile + '.js') || isCoffee;
if(!exists) {
jake.die('Could not load Jakefile.\nIf no Jakefile specified with -f or --jakefile, ' +
@@ -435,11 +431,12 @@ try {
if (isCoffee) {
try {
CoffeeScript = require('coffee-script');
- } catch (e) {
+ }
+ catch (e) {
jake.die('CoffeeScript is missing! Try `npm install coffee-script`');
}
}
- var tasks = require(jakefile);
+ tasks = require(jakefile);
}
catch (e) {
if (e.stack) {

0 comments on commit b1ead4d

Please sign in to comment.