/**
 * Step 5
 * Where you write the generator specific files (routes, controllers, etc)
 */

const FILES_MAP = {
  add: ['api/blueprints/add.js', 'test/unit/blueprints/add.test.js'],
  create: ['api/blueprints/create.js', 'test/unit/blueprints/create.test.js'],
  destroy: ['api/blueprints/destroy.js', 'test/unit/blueprints/destroy.test.js'],
  find: ['api/blueprints/find.js', 'test/unit/blueprints/find.test.js'],
  findOne: ['api/blueprints/findone.js', 'test/unit/blueprints/findone.test.js'],
  populate: ['api/blueprints/populate.js', 'test/unit/blueprints/populate.test.js'],
  remove: ['api/blueprints/remove.js', 'test/unit/blueprints/remove.test.js'],
  update: ['api/blueprints/update.js', 'test/unit/blueprints/update.test.js']
};

export default function () {
  if (this.options['use-default']) {
    this.copy('api/blueprints/.gitkeep', 'api/blueprints/.gitkeep');
    this.copy('test/unit/blueprints/.gitkeep', 'test/unit/blueprints/.gitkeep');
  } else {
    Object.keys(FILES_MAP).forEach(blueprint => FILES_MAP[blueprint].forEach(path => this.copy(path, path)));
  }
};

@@ -91,23 +91,169 @@
 */%0A%0A
-const FILES_MAP
+import fs from 'fs';%0Aimport path from 'path';%0A%0Aconst GIT_KEEP_FILES = %5B%0A  'api/blueprints/.gitkeep',%0A  'test/unit/blueprints/.gitkeep'%0A%5D;%0A%0Aconst BLUEPRINTS_FILES
  = %7B
@@ -889,234 +889,396 @@
 %7D;%0A%0A
-export default function () %7B%0A  if (this.options%5B'use-default'%5D) %7B%0A    this.copy('api/blueprints/.gitkeep', 'api/blueprints/.gitkeep');%0A    this.copy('test/unit/blueprints/.gitkeep', 'test/unit/blueprints/.gitkeep');%0A  %7D else %7B
+const removeFile = file =%3E fs.existsSync(file) ? fs.unlinkSync(path.resolve(process.cwd(), file)) : false;%0A%0Aexport default function () %7B%0A  if (this.options%5B'use-default'%5D) %7B%0A    GIT_KEEP_FILES.forEach(file =%3E this.copy(file, file));%0A    Object.keys(BLUEPRINTS_FILES).forEach(blueprint =%3E BLUEPRINTS_FILES%5Bblueprint%5D.forEach(removeFile));%0A  %7D else %7B%0A    GIT_KEEP_FILES.forEach(removeFile);
 %0A   
@@ -1290,25 +1290,32 @@
 ct.keys(
+BLUEPRINTS_
 FILES
-_MAP
 ).forEac
@@ -1333,17 +1333,24 @@
  =%3E 
+BLUEPRINTS_
 FILES
-_MAP
 %5Bblu
@@ -1365,20 +1365,20 @@
 forEach(
-path
+file
  =%3E this
@@ -1387,18 +1387,18 @@
 opy(
-path, path
+file, file
 )));

Implement removing blueprints if you regenerate with --use-default