Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Fixes for issues 1196 and 1197 #199

Merged
merged 5 commits into from Sep 25, 2012
View
@@ -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;
View
@@ -106,14 +106,20 @@ 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
templ = new adapter({data: {ext: '.ejs'}, text: text, templato: templato});
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);