Skip to content

Commit

Permalink
fix: update dependency mkdirp to 1.x (#5748)
Browse files Browse the repository at this point in the history
  • Loading branch information
urdeveloper authored Mar 27, 2020
1 parent 0aba8a2 commit edeb561
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 25 deletions.
92 changes: 85 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
"dotenv": "^6.2.0",
"glob": "^7.1.2",
"js-yaml": "^3.13.1",
"mkdirp": "^0.5.1",
"mkdirp": "^1.0.3",
"reflect-metadata": "^0.1.13",
"sha.js": "^2.4.11",
"tslib": "^1.9.0",
Expand Down
2 changes: 1 addition & 1 deletion src/commands/CommandUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export class CommandUtils {
* Creates directories recursively.
*/
static createDirectories(directory: string) {
return new Promise((ok, fail) => mkdirp(directory, (err: any) => err ? fail(err) : ok()));
return mkdirp(directory);
}

/**
Expand Down
30 changes: 14 additions & 16 deletions src/driver/sqlite/SqliteDriver.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import {DriverPackageNotInstalledError} from "../../error/DriverPackageNotInstalledError";
import {SqliteQueryRunner} from "./SqliteQueryRunner";
import {DriverOptionNotSetError} from "../../error/DriverOptionNotSetError";
import {PlatformTools} from "../../platform/PlatformTools";
import {Connection} from "../../connection/Connection";
import {SqliteConnectionOptions} from "./SqliteConnectionOptions";
import {ColumnType} from "../types/ColumnTypes";
import {QueryRunner} from "../../query-runner/QueryRunner";
import {AbstractSqliteDriver} from "../sqlite-abstract/AbstractSqliteDriver";
import { DriverPackageNotInstalledError } from "../../error/DriverPackageNotInstalledError";
import { SqliteQueryRunner } from "./SqliteQueryRunner";
import { DriverOptionNotSetError } from "../../error/DriverOptionNotSetError";
import { PlatformTools } from "../../platform/PlatformTools";
import { Connection } from "../../connection/Connection";
import { SqliteConnectionOptions } from "./SqliteConnectionOptions";
import { ColumnType } from "../types/ColumnTypes";
import { QueryRunner } from "../../query-runner/QueryRunner";
import { AbstractSqliteDriver } from "../sqlite-abstract/AbstractSqliteDriver";

/**
* Organizes communication with sqlite DBMS.
Expand Down Expand Up @@ -63,14 +63,14 @@ export class SqliteDriver extends AbstractSqliteDriver {
/**
* Creates a query runner used to execute database queries.
*/
createQueryRunner(mode: "master"|"slave" = "master"): QueryRunner {
createQueryRunner(mode: "master" | "slave" = "master"): QueryRunner {
if (!this.queryRunner)
this.queryRunner = new SqliteQueryRunner(this);

return this.queryRunner;
}

normalizeType(column: { type?: ColumnType, length?: number | string, precision?: number|null, scale?: number }): string {
normalizeType(column: { type?: ColumnType, length?: number | string, precision?: number | null, scale?: number }): string {
if ((column.type as any) === Buffer) {
return "blob";
}
Expand Down Expand Up @@ -133,11 +133,9 @@ export class SqliteDriver extends AbstractSqliteDriver {
* Auto creates database directory if it does not exist.
*/
protected createDatabaseDirectory(fullPath: string): Promise<void> {
return new Promise<void>((resolve, reject) => {
const mkdirp = PlatformTools.load("mkdirp");
const path = PlatformTools.load("path");
mkdirp(path.dirname(fullPath), (err: any) => err ? reject(err) : resolve());
});
const mkdirp = PlatformTools.load("mkdirp");
const path = PlatformTools.load("path");
return mkdirp(path.dirname(fullPath));
}

}

0 comments on commit edeb561

Please sign in to comment.