Skip to content

Commit

Permalink
Fixed up cwd for arbitrary command types and improved make plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
EricMCornelius committed Aug 27, 2013
1 parent 91f0a65 commit f38aafc
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/actions.js
Expand Up @@ -148,7 +148,7 @@ function build(graph, node, cmd, cb) {
// if the target is missing, we *must* rebuild it
if (exists(missing_targets[cmd.target])) {
return async.series([
async.apply(colored_exec, [cmd.cmd].concat(cmd.args).join(' ')),
async.apply(colored_exec, [cmd.cmd].concat(cmd.args).join(' '), {cwd: cmd.cwd || node.base || process.cwd()}),
async.apply(async.map, cmd.sources, fingerprint),
async.apply(fingerprint, cmd.target)
], cb);
Expand Down
2 changes: 2 additions & 0 deletions lib/registry/processors/cmake.js
Expand Up @@ -10,6 +10,8 @@ function register(node, registry, cb) {

// prepare the command list corresponding to this node
function generate(graph, node, cb) {
if (!exists(node.type) || node.type.toLowerCase() !== 'cmake') return cb();

node.defines = node.defines || {};
if (node.installdir)
node.defines.CMAKE_INSTALL_PREFIX = node.defines.CMAKE_INSTALL_PREFIX || node.installdir;
Expand Down
2 changes: 1 addition & 1 deletion lib/registry/processors/cplusplus.js
Expand Up @@ -95,7 +95,7 @@ function pkg_config(pkg, cb) {

function register(node, registry, cb) {
var valid_languages = ['C++', 'c++', 'cplusplus', 'cpp'];
if (valid_languages.indexOf(node.language) === -1)
if (!valid_languages.some(function(elem) { return elem === node.language; }))
return cb();

node.language = 'c++';
Expand Down
2 changes: 1 addition & 1 deletion lib/registry/processors/dlang.js
Expand Up @@ -21,7 +21,7 @@ var public = util.public;

function register(node, registry, cb) {
var valid_languages = ['D', 'd', 'dlang'];
if (valid_languages.indexOf(node.language) === -1)
if (!valid_languages.some(function(elem) { return elem === node.language; }))
return cb();

node.language = 'd';
Expand Down
13 changes: 13 additions & 0 deletions lib/registry/processors/make.js
@@ -1,8 +1,21 @@
require('node_extensions');

var assert = require('assert');
var util = require('util');
var path = require('path');
var fs = require('fs');

var exists = util.exists;

var os = require('os');

function register(node, registry, cb) {
if (!exists(node.type) || node.type.toLowerCase() !== 'make') return cb();

node.generate = function(graph, cb) {
processors['make'].generate(graph, this, cb);
}

cb();
}

Expand Down

0 comments on commit f38aafc

Please sign in to comment.