From 5886a207101dc1c9f622d4db9c496ae610fd4b2a Mon Sep 17 00:00:00 2001 From: maxeljkin Date: Tue, 15 Oct 2019 01:06:29 +0300 Subject: [PATCH] fix(seeder): fix method usage --- lib/seed/Seeder.js | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/lib/seed/Seeder.js b/lib/seed/Seeder.js index 63583496d1..6b8889b939 100644 --- a/lib/seed/Seeder.js +++ b/lib/seed/Seeder.js @@ -5,7 +5,7 @@ const fs = require('fs'); const path = require('path'); const mkdirp = require('mkdirp'); const Bluebird = require('bluebird'); -const { filter, includes, template, extend } = require('lodash'); +const { filter, includes, extend } = require('lodash'); const { writeJsFileUsingTemplate } = require('../util/template'); // The new seeds we're performing, typically called from the `knex.seed` @@ -20,7 +20,7 @@ class Seeder { // Runs seed files for the given environment. async run(config) { this.config = this.setConfig(config); - const [all] = await this._listAll(); + const all = await this._listAll(); const files = config && config.specific ? all.filter((file) => file === config.specific) @@ -85,14 +85,6 @@ class Seeder { ); } - // Generates the stub template for the current seed file, returning a compiled template. - _generateStubTemplate() { - const stubPath = this._getStubPath(); - return Bluebird.promisify(fs.readFile, { context: fs })(stubPath).then( - (stub) => template(stub.toString(), { variable: 'd' }) - ); - } - _getNewStubFileName(name) { if (name[0] === '-') name = name.slice(1); return name + '.' + this.config.extension;