Skip to content

Commit

Permalink
Fix log directory creation.
Browse files Browse the repository at this point in the history
  • Loading branch information
cliffano committed Jun 15, 2017
1 parent 6f2519a commit c7a7fe3
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions lib/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@ function exec(command, opts, cb) {

console.log('%s | %s', command.meta.task.cyan, command.exec);

var logDir = opts.logDir.replace(/\{lang\}/g, command.meta.language);
var logFile = p.join(logDir, util.format('%s.log', command.meta.type));
mkdirp.sync(logDir);

var logFile = p.join(opts.logDir, util.format('%s.log', command.meta.type));
var cproc = child.exec(command.exec, opts, cb);
var wstream = fs.createWriteStream(logFile);

Expand Down Expand Up @@ -58,8 +55,8 @@ function exec(command, opts, cb) {
function execSeries(commands, opts, cb) {

function _exec(command, cb) {
var logDir = p.join(opts.logDir, command.meta.language);
mkdirp(logDir, function (err) {
opts.logDir = opts.logDir.replace(/\{lang\}/g, command.meta.language);
mkdirp(opts.logDir, function (err) {
if (err) { cb(err); } else {
exec(command, opts, cb);
}
Expand Down

0 comments on commit c7a7fe3

Please sign in to comment.