Permalink
Browse files

Added generator for auth:update

  • Loading branch information...
1 parent 3ecf975 commit aa49bd92bb93ff53dad4270e36681fecfc4bd406 mde committed Nov 10, 2012
Showing with 27 additions and 0 deletions.
  1. +5 −0 bin/cli.js
  2. +22 −0 templates/Jakefile
View
5 bin/cli.js
@@ -136,6 +136,7 @@ if (cmds.length) {
cmds[0] == 'secret' ||
cmds[0] == 'db:init' ||
cmds[0] == 'auth' ||
+ cmds[0] == 'auth:update' ||
cmds[0] == 'console')
&& !cmds[1]) {
throw new Error(cmds[0] + ' command requires another argument.');
@@ -176,6 +177,10 @@ if (cmds.length) {
// Create DBs
cmd += 'auth:init';
break;
+ case 'auth:update':
+ // Create DBs
+ cmd += 'auth:update';
+ break;
case 'db:init':
// Create DBs
cmd += 'db:init';
View
22 templates/Jakefile
@@ -734,6 +734,28 @@ namespace('gen', function () {
namespace('auth', function () {
+ task('update', {async: true}, function () {
+ // FIXME: Pull these version numbers out of geddy-passport's package.json
+ var cwd = process.cwd()
+ , packages = 'geddy-passport@0.0.x'
+ , updatePath = path.join('geddy-passport', 'app',
+ 'helpers', 'passport');
+
+ console.log('Updating helper from ' + packages + '...');
+ jake.exec('npm uninstall ' + packages +
+ ' && npm install ' + packages, function () {
+ var from = path.join(cwd, 'node_modules', updatePath)
+ , to = path.join(cwd, 'app', 'helpers');
+ jake.rmRf(path.join(to, 'passport'), {silent: true});
+ jake.cpR(from, to, {silent: true});
+ console.log('Updated helper from ' + packages);
+ console.log('Cleaning up...');
+ jake.exec('npm uninstall geddy-passport', function () {
+ complete();
+ });
+ }, {printStdout: true});
+ });
+
task('init', {async: true}, function () {
var go = false
// FIXME: Pull these version numbers out of geddy-passport's package.json

0 comments on commit aa49bd9

Please sign in to comment.