@mcoda/shared 0.1.37 → 0.1.38
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.
|
@@ -7,6 +7,7 @@ export declare class PathHelper {
|
|
|
7
7
|
static resolveRelativePath(root: string, target: string): string;
|
|
8
8
|
static isPathInside(root: string, target: string): boolean;
|
|
9
9
|
static getGlobalMcodaDir(): string;
|
|
10
|
+
static getGlobalConfigPath(): string;
|
|
10
11
|
static getGlobalDbPath(): string;
|
|
11
12
|
static getGlobalWorkspaceDir(workspaceRoot: string): string;
|
|
12
13
|
static getWorkspaceDir(workspaceRoot?: string): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PathHelper.d.ts","sourceRoot":"","sources":["../../src/paths/PathHelper.ts"],"names":[],"mappings":"AAKA;;;GAGG;AACH,qBAAa,UAAU;IACrB,MAAM,CAAC,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAK/C,MAAM,CAAC,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM;IAMhE,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO;IAM1D,MAAM,CAAC,iBAAiB,IAAI,MAAM;IAMlC,MAAM,CAAC,eAAe,IAAI,MAAM;IAIhC,MAAM,CAAC,qBAAqB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM;IAQ3D,MAAM,CAAC,eAAe,CAAC,aAAa,GAAE,MAAsB,GAAG,MAAM;IAIrE,MAAM,CAAC,kBAAkB,CAAC,aAAa,GAAE,MAAsB,GAAG,MAAM;WAI3D,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAGnD"}
|
|
1
|
+
{"version":3,"file":"PathHelper.d.ts","sourceRoot":"","sources":["../../src/paths/PathHelper.ts"],"names":[],"mappings":"AAKA;;;GAGG;AACH,qBAAa,UAAU;IACrB,MAAM,CAAC,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAK/C,MAAM,CAAC,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM;IAMhE,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO;IAM1D,MAAM,CAAC,iBAAiB,IAAI,MAAM;IAMlC,MAAM,CAAC,mBAAmB,IAAI,MAAM;IAQpC,MAAM,CAAC,eAAe,IAAI,MAAM;IAIhC,MAAM,CAAC,qBAAqB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM;IAQ3D,MAAM,CAAC,eAAe,CAAC,aAAa,GAAE,MAAsB,GAAG,MAAM;IAIrE,MAAM,CAAC,kBAAkB,CAAC,aAAa,GAAE,MAAsB,GAAG,MAAM;WAI3D,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAGnD"}
|
package/dist/paths/PathHelper.js
CHANGED
|
@@ -27,6 +27,13 @@ export class PathHelper {
|
|
|
27
27
|
const homeDir = envHome && envHome.trim().length > 0 ? envHome : os.homedir();
|
|
28
28
|
return path.join(homeDir, ".mcoda");
|
|
29
29
|
}
|
|
30
|
+
static getGlobalConfigPath() {
|
|
31
|
+
const configuredPath = process.env.MCODA_CONFIG?.trim();
|
|
32
|
+
if (configuredPath) {
|
|
33
|
+
return path.resolve(configuredPath);
|
|
34
|
+
}
|
|
35
|
+
return path.join(this.getGlobalMcodaDir(), "config.json");
|
|
36
|
+
}
|
|
30
37
|
static getGlobalDbPath() {
|
|
31
38
|
return path.join(this.getGlobalMcodaDir(), "mcoda.db");
|
|
32
39
|
}
|