Skip to content

Commit

Permalink
fix(seeder): fix method usage
Browse files Browse the repository at this point in the history
  • Loading branch information
maxeljkin committed Oct 15, 2019
1 parent 27203a7 commit 5e9343e
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions lib/seed/Seeder.js
Expand Up @@ -5,8 +5,7 @@ const fs = require('fs');
const path = require('path');
const { promisify } = require('util');
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`
Expand All @@ -21,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)
Expand Down Expand Up @@ -87,14 +86,6 @@ class Seeder {
);
}

// Generates the stub template for the current seed file, returning a compiled template.
_generateStubTemplate() {
const stubPath = this._getStubPath();
return promisify(fs.readFile)(stubPath).then(
(stub) => template(stub.toString(), { variable: 'd' })
);
}

_getNewStubFileName(name) {
if (name[0] === '-') name = name.slice(1);
return name + '.' + this.config.extension;
Expand Down

0 comments on commit 5e9343e

Please sign in to comment.