logshield-cli 0.2.5 → 0.2.7
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/dist/cli/index.cjs +10 -1
- package/package.json +1 -1
package/dist/cli/index.cjs
CHANGED
|
@@ -346,6 +346,8 @@ var init_sanitizeLog = __esm({
|
|
|
346
346
|
});
|
|
347
347
|
|
|
348
348
|
// src/cli/index.ts
|
|
349
|
+
var import_fs = __toESM(require("fs"));
|
|
350
|
+
var import_path = __toESM(require("path"));
|
|
349
351
|
var { readInput: readInput2 } = (init_readInput(), __toCommonJS(readInput_exports));
|
|
350
352
|
var { writeOutput: writeOutput2 } = (init_writeOutput(), __toCommonJS(writeOutput_exports));
|
|
351
353
|
var { printSummary: printSummary2 } = (init_summary(), __toCommonJS(summary_exports));
|
|
@@ -355,7 +357,14 @@ function hasFlag(flag) {
|
|
|
355
357
|
return args.includes(flag);
|
|
356
358
|
}
|
|
357
359
|
function getVersion() {
|
|
358
|
-
|
|
360
|
+
try {
|
|
361
|
+
const cliPath = process.argv[1];
|
|
362
|
+
const pkgPath = import_path.default.resolve(cliPath, "../../../package.json");
|
|
363
|
+
const pkg = JSON.parse(import_fs.default.readFileSync(pkgPath, "utf8"));
|
|
364
|
+
return pkg.version;
|
|
365
|
+
} catch {
|
|
366
|
+
return "unknown";
|
|
367
|
+
}
|
|
359
368
|
}
|
|
360
369
|
function getFileArg() {
|
|
361
370
|
const file = args[1];
|