Skip to content

Commit

Permalink
Changes usage of jake.exec to child_process.exec to avoid to avoid pr…
Browse files Browse the repository at this point in the history
…oblems when requiring jake during the tests
  • Loading branch information
MiguelMadero committed Feb 27, 2013
1 parent 5bafa03 commit 380c3a3
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions templates/templates_path.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
require('../lib/geddy');

var path = require('path')
, utils = require('../lib/utils')
, jake = require('jake');
, exec = require('child_process').exec;

reportPath = function (path, cb) {
var reportPath = function (path, cb) {
console.log("Using templates in: " + path);
cb(path);
};

getModulePath = function (cmdToGetPathFrom, templatesFullName, getModulePathCallback) {
var exec = jake.createExec(cmdToGetPathFrom);
exec.addListener('stdout', function (modulesPath) {
modulesPath = modulesPath.toString();
modulesPath = modulesPath.split("\n")[0];
var getModulePath = function (cmdToGetPathFrom, templatesFullName, getModulePathCallback) {
exec(cmdToGetPathFrom, function (err, stdout, stderror) {
if (err) {
throw err;
}
var modulesPath = stdout.split("\n")[0];
modulesPath = path.join(modulesPath, templatesFullName, 'templates');
getModulePathCallback(modulesPath);
});
exec.run();
};

getTemplatesPath = function (templatesNameOrPath, cb) {
var getTemplatesPath = function (templatesNameOrPath, cb) {
var customTemplatePath = path.join(templatesNameOrPath, 'templates')
, templatesFullName = 'geddy-'+ templatesNameOrPath + '-templates'

Expand All @@ -45,4 +43,5 @@ getTemplatesPath = function (templatesNameOrPath, cb) {
});
};

module.exports.getTemplatesPath = getTemplatesPath;
module.exports.getTemplatesPath = getTemplatesPath;
//require('./templates/templates_path')

0 comments on commit 380c3a3

Please sign in to comment.