logshield-cli 0.2.5 → 0.2.6

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.
@@ -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,13 @@ function hasFlag(flag) {
355
357
  return args.includes(flag);
356
358
  }
357
359
  function getVersion() {
358
- return process.env.npm_package_version || "unknown";
360
+ try {
361
+ const pkgPath = import_path.default.resolve(__dirname, "../../package.json");
362
+ const pkg = JSON.parse(import_fs.default.readFileSync(pkgPath, "utf8"));
363
+ return pkg.version;
364
+ } catch {
365
+ return "unknown";
366
+ }
359
367
  }
360
368
  function getFileArg() {
361
369
  const file = args[1];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "logshield-cli",
3
- "version": "0.2.5",
3
+ "version": "0.2.6",
4
4
  "type": "commonjs",
5
5
  "bin": {
6
6
  "logshield": "dist/cli/index.cjs"