Skip to content

Commit

Permalink
Merge pull request #10 from halvardssm/fix-buggy-import
Browse files Browse the repository at this point in the history
fixed buggy default import import
  • Loading branch information
halvardssm authored Apr 30, 2020
2 parents cdcde04 + 5f52f84 commit f7fe232
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions cli/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { PGSQL } from "./pgsql.ts";
import { ClientTypes, ClientI } from "./utils.ts";
import { MySQL } from "./mysql.ts";
import { SQLite } from "./sqlite.ts";
import StdConfig from "../nessie.config.ts";

export class State {
private enableDebug: boolean;
Expand All @@ -31,17 +32,17 @@ export class State {
}

async init() {
let configFile;
let config: nessieConfig = StdConfig;

try {
configFile = await import(
const rawConfig = await import(
this._parsePath(this.configFile, "nessie.config.ts")
);

config = rawConfig.default;
} catch (e) {
configFile = await import("../nessie.config.ts");
this.debug("Using standard config");
} finally {
const config: nessieConfig = configFile.default;

this.debug(config, "Config");

this.migrationFolder = this._parsePath(
Expand Down

0 comments on commit f7fe232

Please sign in to comment.