oopsx 1.1.0 → 1.2.0

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.
Files changed (2) hide show
  1. package/bin/merr.js +6 -2
  2. package/package.json +1 -1
package/bin/merr.js CHANGED
@@ -2,8 +2,12 @@
2
2
 
3
3
  import { existsSync, readFileSync, appendFileSync, writeFileSync } from "node:fs";
4
4
  import { homedir } from "node:os";
5
- import { join } from "node:path";
5
+ import { join, dirname } from "node:path";
6
+ import { fileURLToPath } from "node:url";
6
7
  import { Command } from "commander";
8
+
9
+ const __dirname = dirname(fileURLToPath(import.meta.url));
10
+ const pkg = JSON.parse(readFileSync(join(__dirname, "..", "package.json"), "utf-8"));
7
11
  import { runCommand } from "../src/runner.js";
8
12
  import { resolveSound, playAudio, setDefault, setVolume } from "../src/sound.js";
9
13
  import { readConfig } from "../src/config.js";
@@ -35,7 +39,7 @@ const program = new Command();
35
39
  program
36
40
  .name("oopsx")
37
41
  .description("Play a meme sound when your terminal command fails")
38
- .version("1.0.0");
42
+ .version(pkg.version);
39
43
 
40
44
  // --- `oopsx init <shell>` — output shell hook snippet ---
41
45
  program
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oopsx",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "Play a meme sound when your terminal command fails",
5
5
  "type": "module",
6
6
  "bin": {