diff --git a/bin/cli.js b/bin/cli.js index 8d1ed77e..e5287656 100755 --- a/bin/cli.js +++ b/bin/cli.js @@ -179,7 +179,10 @@ if(cmds.length) { die(cmds[0] + ' is not a Geddy command.'); } - //cmd += ' --quiet'; + if (!opts.debug) { + cmd += ' --quiet'; + } + exec(cmd, function(err, stdout, stderr) { if(err) { throw err; diff --git a/templates/Jakefile b/templates/Jakefile index 4f6997e2..867ada32 100644 --- a/templates/Jakefile +++ b/templates/Jakefile @@ -106,6 +106,7 @@ namespace('gen', function () { , text = fs.readFileSync(path.join(__dirname, filename + '.ejs'), 'utf8').toString() , bare = options.bare || false // Default to full controller , templ + , fileDir , filePath; // Render with the right model name @@ -113,7 +114,12 @@ namespace('gen', function () { templ.process({names: names, bare: bare, properties: options.properties}); // Write file - filePath = path.join('app', dirname, names.filename[options.inflection] + '.js'); + fileDir = path.join('app', dirname); + if (!utils.file.existsSync(fileDir)) { + fs.mkdirSync(fileDir); + } + + filePath = path.join(fileDir, names.filename[options.inflection] + '.js'); fs.writeFileSync(filePath, templ.markup, 'utf8'); console.log('[Added] ' + filePath);