@miloya/oc-minimax-status 0.1.2 → 0.1.3

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/init.js +8 -3
  2. package/package.json +1 -1
package/bin/init.js CHANGED
@@ -28,9 +28,14 @@ function getCommandDir() {
28
28
  return path.join(home, ".config", "opencode", "commands");
29
29
  }
30
30
 
31
- function getPackageDir() {
32
- return process.cwd();
33
- }
31
+ function getPackageDir() {
32
+ // When running postinstall for global install, use npm_package_json env var
33
+ const pkgJson = process.env.npm_package_json;
34
+ if (pkgJson) {
35
+ return path.dirname(pkgJson);
36
+ }
37
+ return process.cwd();
38
+ }
34
39
 
35
40
  function updateOpencodeConfig() {
36
41
  const configPath = getOpencodeConfigPath();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@miloya/oc-minimax-status",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "MiniMax Coding Plan 用量查询插件 for OpenCode - 一键安装自动配置",
5
5
  "main": "index.js",
6
6
  "type": "module",