Permalink
Browse files

revert to the last commit with only rule support.

  • Loading branch information...
1 parent 885b595 commit 2485b23365cb876a5bd758848a54229d83de55a7 @xiejw xiejw committed Mar 31, 2013
Showing with 11 additions and 42 deletions.
  1. 0 jake
  2. +1 −31 lib/api.js
  3. +1 −1 lib/task/rule.js
  4. +9 −10 lib/utils/index.js
View
0 jake 100755 → 100644
No changes.
View
@@ -15,39 +15,9 @@
* limitations under the License.
*
*/
-
-//var exec = require('child_process').exec;
-
-
-var util = require('util');
+var exec = require('child_process').exec;
var api = new (function () {
-
- // This is stronger exec, with sync support
- this.exec = function() {
- var args = Array.prototype.slice.call(arguments);
- var opts = {};
- var cmds = [];
-
- if (typeof args[args.length-1] == 'object') {
- opts = args.pop();
- }
-
- if( ! Array.isArray(args[0]) ) {
- // Single cmd
- cmds.push( util.format.apply(null, args) );
- } else {
- // Array of cmds
- for (var cmd in args) {
- cmds.push(util.format.apply(null, cmd))
- }
- }
-
- jake.exec(cmds, function () {
- if (! opts.not_finished) { complete(); }
- }, {interactive: true});
- };
-
/**
@name task
@static
View
@@ -5,7 +5,7 @@ var stringEndWith = function (a,b) {
return (l = b.lastIndexOf(a)) == -1 ? false : l + a.length == b.length;
}
-// Replace the suffix a of the string s with new suffix b.
+// Replace the suffix a of the string s with b.
var stringReplaceSuffix = function (s,a,b) {
return s.slice(0,s.lastIndexOf(a)) + b;
}
View
@@ -183,25 +183,24 @@ utils.mixin(Exec.prototype, new (function () {
}
if (config.interactive) {
- console.log( next );
- sh = spawn(cmd, args, { stdio: 'inherit'});
+ sh = spawn(cmd, args, { stdio: [process.stdin, process.stdout, 'pipe']});
}
else {
sh = spawn(cmd, args, { stdio: [process.stdin, 'pipe', 'pipe'] });
// Out
sh.stdout.on('data', function (data) {
self.emit('stdout', data);
});
- // Err
- sh.stderr.on('data', function (data) {
- var d = data.toString();
- self.emit('stderr', data);
- // Accumulate the error-data so we can use it as the
- // stack if the process exits with an error
- errData += d;
- });
}
+ // Err
+ sh.stderr.on('data', function (data) {
+ var d = data.toString();
+ self.emit('stderr', data);
+ // Accumulate the error-data so we can use it as the
+ // stack if the process exits with an error
+ errData += d;
+ });
// Exit, handle err or run next
sh.on('exit', function (code) {

0 comments on commit 2485b23

Please sign in to comment.