mfer 4.0.0 → 4.0.1
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.
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { inspect } from "util";
|
|
1
2
|
import { Command } from "commander";
|
|
2
3
|
import { configExists, currentConfig, warnOfMissingConfig, } from "../../../utils/config-utils.js";
|
|
3
4
|
export const listConfigCommand = new Command("list")
|
|
4
5
|
.description("display the current configuration settings")
|
|
5
6
|
.action(() => {
|
|
6
7
|
if (configExists) {
|
|
7
|
-
console.log(currentConfig);
|
|
8
|
+
console.log(inspect(currentConfig, { depth: null, colors: true }));
|
|
8
9
|
}
|
|
9
10
|
else {
|
|
10
11
|
warnOfMissingConfig();
|
|
@@ -10,11 +10,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
import * as fs from "fs";
|
|
11
11
|
import * as path from "path";
|
|
12
12
|
import * as os from "os";
|
|
13
|
+
import { fileURLToPath } from "url";
|
|
13
14
|
import chalk from "chalk";
|
|
14
15
|
import { spawnSync } from "child_process";
|
|
15
16
|
const NOTIFIED_VERSION_FILE = path.join(os.homedir(), ".mfer", ".last-notified-version");
|
|
16
17
|
export function getInstalledVersion() {
|
|
17
|
-
const packageJsonPath = path.join(path.dirname(
|
|
18
|
+
const packageJsonPath = path.join(path.dirname(fileURLToPath(import.meta.url)), "../../package.json");
|
|
18
19
|
try {
|
|
19
20
|
const raw = fs.readFileSync(packageJsonPath, "utf8");
|
|
20
21
|
return JSON.parse(raw).version;
|