var fs = require('fs-extra');

// Private: Copy routes.js from templates folder into user's `/both` folder
//          If file already exists, do not overwrite.
exports.create = function() {
  var destRoot, routeSrc, routeDest;

  destRoot = 'both/';
  routeSrc = templatePath + 'router/routes.js';
  routeDest = destRoot + 'routes.js';

  // create both folder if it doesn't already exisit
  fs.mkdirsSync(destRoot);

  // bail if router already exists
  if (fs.existsSync(destRoot + 'routes.js')) return;

  // copy router.js from templates/ to project/both/controllers
  fs.copySync(routeSrc, routeDest);
  console.log('  Created both/routes.js');
};


@@ -158,24 +158,36 @@
 te.%0A
-exports.
+module.exports = %7B%0A  
 create
- =
+:
  fun
@@ -198,16 +198,18 @@
 n() %7B%0A  
+ 
+ 
 var dest
@@ -236,16 +236,18 @@
 eDest;%0A%0A
+  
   destRo
@@ -260,16 +260,18 @@
 both/';%0A
+  
   routeS
@@ -312,16 +312,18 @@
 .js';%0A  
+ 
+ 
 routeDes
@@ -351,16 +351,18 @@
 s.js';%0A%0A
+  
   // cre
@@ -408,16 +408,18 @@
 xisit%0A  
+ 
+ 
 fs.mkdir
@@ -436,16 +436,18 @@
 Root);%0A%0A
+  
   // bai
@@ -473,16 +473,18 @@
  exists%0A
+  
   if (fs
@@ -529,16 +529,18 @@
 eturn;%0A%0A
+  
   // cop
@@ -595,16 +595,18 @@
 rollers%0A
+  
   fs.cop
@@ -633,16 +633,18 @@
 eDest);%0A
+  
   consol
@@ -682,8 +682,18 @@
 ');%0A
-%7D;
+  %7D%0A%7D;%0A  %0A  
 %0A%0A

convert create function into router object