Skip to content

Commit

Permalink
Update geddy auth to work with changes to geddy-passport
Browse files Browse the repository at this point in the history
  • Loading branch information
mde committed Mar 17, 2013
1 parent 12cbbb9 commit 3f8f8a5
Showing 1 changed file with 24 additions and 13 deletions.
37 changes: 24 additions & 13 deletions templates/Jakefile
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -855,8 +855,10 @@ namespace('auth', function () {
}); });


task('init', {async: true}, function (engine) { task('init', {async: true}, function (engine) {
var readline = require('readline') var env = process.env
, fromBase = path.join(cwd, 'node_modules', 'geddy-passport') , readline = require('readline')
, fromBase = env.srcDir ||
path.join(cwd, 'node_modules', 'geddy-passport')
, install = false , install = false
, rl, installPackages, passportCopy; , rl, installPackages, passportCopy;


Expand Down Expand Up @@ -886,9 +888,15 @@ namespace('auth', function () {
return; return;
} }


console.log('Installing', geddyPassport); if (env.srcDir) {
jake.exec('npm uninstall ' + geddyPassport + console.log('Installing from ' + fromBase);
' && npm install ' + geddyPassport, installPackages, {printStdout: true}); installPackages();
}
else {
console.log('Installing', geddyPassport);
jake.exec('npm uninstall ' + geddyPassport +
' && npm install ' + geddyPassport, installPackages, {printStdout: true});
}
}); });


// Gets the package versions from geddy-passport's package.json // Gets the package versions from geddy-passport's package.json
Expand Down Expand Up @@ -917,7 +925,13 @@ namespace('auth', function () {
, from , from
, to , to
, p , p
, i; , i
, engineExt = {
ejs: '.ejs'
, jade: '.jade'
, handlebars: '.hbs'
, mustache: '.ms'
};


// Copy files to the application // Copy files to the application
for (i = 0; i < list.length; i++) { for (i = 0; i < list.length; i++) {
Expand All @@ -926,16 +940,13 @@ namespace('auth', function () {
to = path.dirname(path.join(cwd, item)); to = path.dirname(path.join(cwd, item));


if (item.match('/app/views')) { if (item.match('/app/views')) {
// If the view is not for the given engine, skip it from = from.replace('/app/views', '/app/views_' + engine);
if (!item.match(engine)) { from = from.replace(/\[\.ext\]$/, engineExt[engine]);
continue; to = to.replace(/\[\.ext\]$/, engineExt[engine]);
}

to = to.replace(engine, "");
} }


jake.mkdirP(to); jake.mkdirP(to);
console.log('Creating file:', path.join(to, path.basename(item))); console.log('Creating file:', path.join(to, path.basename(from)));


// Delete any existing interferring templates // Delete any existing interferring templates
if (item.match('/app/views')) { if (item.match('/app/views')) {
Expand Down

0 comments on commit 3f8f8a5

Please sign in to comment.