@datatruck/cli 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @datatruck/cli
2
2
 
3
+ ## 0.0.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [`d9e534b`](https://github.com/swordev/datatruck/commit/d9e534bd968acf9cd1c93f20e6152c004cb1f23b) Thanks [@juanrgm](https://github.com/juanrgm)! - Fix package file read
8
+
9
+ * [`b882c58`](https://github.com/swordev/datatruck/commit/b882c58183e9a75abc876645e18d7b67186dd662) Thanks [@juanrgm](https://github.com/juanrgm)! - Fix read of migrations
10
+
3
11
  ## 0.0.3
4
12
 
5
13
  ### Patch Changes
@@ -11,6 +11,7 @@ const RestoreSessionEntity_1 = require("../Entity/RestoreSessionEntity");
11
11
  const RestoreSessionRepositoryEntity_1 = require("../Entity/RestoreSessionRepositoryEntity");
12
12
  const cli_util_1 = require("../util/cli-util");
13
13
  const entity_util_1 = require("../util/entity-util");
14
+ const path_util_1 = require("../util/path-util");
14
15
  const process_util_1 = require("../util/process-util");
15
16
  const SessionDriverAbstract_1 = require("./SessionDriverAbstract");
16
17
  const assert_1 = require("assert");
@@ -30,7 +31,7 @@ class SqliteSessionDriver extends SessionDriverAbstract_1.SessionDriverAbstract
30
31
  driver: sqlite3_1.default.Database,
31
32
  });
32
33
  await this.db.migrate({
33
- migrationsPath: __dirname + "/../../migrations",
34
+ migrationsPath: (0, path_1.join)(path_util_1.rootPath, "migrations"),
34
35
  });
35
36
  }
36
37
  buildInsertStm(tableName, values) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datatruck/cli",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "description": "Tool for creating and managing backups",
5
5
  "homepage": "https://github.com/swordev/datatruck#readme",
6
6
  "bugs": {
package/util/fs-util.js CHANGED
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.writePathLists = exports.forEachFile = exports.checkDir = exports.checkFile = exports.readPartialFile = exports.mkTmpDir = exports.tmpDir = exports.sessionTmpDir = exports.parentTmpDir = exports.existsFile = exports.findFile = exports.parsePackageFile = exports.parseFile = exports.parseFileExtensions = exports.readdirIfExists = exports.writeJSONFile = exports.existsDir = exports.ensureEmptyDir = exports.mkdirIfNotExists = exports.isDirEmpty = exports.isLocalDir = void 0;
4
+ const path_util_1 = require("./path-util");
4
5
  const crypto_1 = require("crypto");
5
6
  const fs_1 = require("fs");
6
7
  const fs_2 = require("fs");
@@ -75,7 +76,7 @@ async function parseFile(path, jsKey) {
75
76
  }
76
77
  exports.parseFile = parseFile;
77
78
  function parsePackageFile() {
78
- return require(`${__dirname}/../../package.json`);
79
+ return require(`${path_util_1.rootPath}/package.json`);
79
80
  }
80
81
  exports.parsePackageFile = parsePackageFile;
81
82
  async function findFile(sourcePath, baseName, extensions, errorMessage = "Path not found") {
@@ -0,0 +1 @@
1
+ export declare const rootPath: string;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.rootPath = void 0;
4
+ const path_1 = require("path");
5
+ const fromSrc = __filename.endsWith(".ts");
6
+ exports.rootPath = fromSrc
7
+ ? (0, path_1.normalize)(`${__dirname}/../../`)
8
+ : (0, path_1.normalize)(`${__dirname}/../`);