Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Include engine in auth:init, auth:init will now use the give engines

views.
  • Loading branch information...
commit c189922d59e75453fffa77b04b57a7ad9332a809 1 parent a9d96ec
@larzconwell larzconwell authored
Showing with 24 additions and 9 deletions.
  1. +4 −4 bin/cli.js
  2. +20 −5 templates/Jakefile
View
8 bin/cli.js
@@ -232,15 +232,15 @@ if (cmds.length) {
jakeArgs = cmds.slice(1);
break;
case 'console':
- // Create DBs
+ // Start console
cmd += 'console:start[' + (cmds[1] || 'development') + ']';
break;
case 'auth':
- // Create DBs
- cmd += 'auth:init';
+ // Create authentication
+ cmd += 'auth:init[' + engineCmd.substr(1) + ']';
break;
case 'auth:update':
- // Create DBs
+ // Update authentication
cmd += 'auth:update';
break;
case 'db:init':
View
25 templates/Jakefile
@@ -862,12 +862,16 @@ namespace('auth', function () {
}, {printStdout: true});
});
- task('init', {async: true}, function () {
+ task('init', {async: true}, function (engine) {
var readline = require('readline')
, fromBase = path.join(cwd, 'node_modules', 'geddy-passport')
, install = false
, rl, installPackages, passportCopy;
+ if (!engine || engine == 'default') {
+ engine = 'ejs';
+ }
+
// Create and start the prompt
rl = readline.createInterface({
input: process.stdin
@@ -892,7 +896,7 @@ namespace('auth', function () {
console.log('Installing', geddyPassport);
jake.exec('npm uninstall ' + geddyPassport +
- ' && npm install ' + geddyPassport, installPackages, {printStdout: true})
+ ' && npm install ' + geddyPassport, installPackages, {printStdout: true});
});
// Gets the package versions from geddy-passport's package.json
@@ -917,17 +921,28 @@ namespace('auth', function () {
, routerPath = getRouterPath()
, newRoute
, from
- , to;
+ , to
+ , i;
// Copy files to the application
- list.forEach(function (item) {
+ for (i = 0; i < list.length; i++) {
+ item = list[i];
from = path.join(fromBase, item);
to = path.dirname(path.join(cwd, item));
+ if (item.match('/app/views')) {
+ // If the view is not for the given engine, skip it
+ if (!item.match(engine)) {
+ continue;
+ }
+
+ to = to.replace(engine, "");
+ }
+
jake.mkdirP(to);
console.log('Creating file:', item);
jake.cpR(from, to, {silent: true});
- });
+ }
// Add new routes to router
if (routerPath) {
Please sign in to comment.
Something went wrong with that request. Please try again.