@miloya/oc-minimax-status 0.1.1 → 0.1.2

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 +12 -8
  2. package/package.json +1 -1
package/bin/init.js CHANGED
@@ -88,17 +88,21 @@ async function init() {
88
88
  fs.copyFileSync(srcIndex, destIndex);
89
89
  console.log(` [OK] Copied ${PLUGIN_NAME}.js`);
90
90
 
91
- // Copy command file
91
+ // Copy command files
92
92
  const commandDir = getCommandDir();
93
- const srcCommand = path.join(packageDir, "commands", "minimax.md");
94
- const destCommand = path.join(commandDir, "minimax.md");
93
+
94
+ if (!fs.existsSync(commandDir)) {
95
+ fs.mkdirSync(commandDir, { recursive: true });
96
+ }
95
97
 
96
- if (fs.existsSync(srcCommand)) {
97
- if (!fs.existsSync(commandDir)) {
98
- fs.mkdirSync(commandDir, { recursive: true });
98
+ const cmdFiles = ["minimax.md", "minimax-set.md"];
99
+ for (const cmdFile of cmdFiles) {
100
+ const srcCommand = path.join(packageDir, "commands", cmdFile);
101
+ const destCommand = path.join(commandDir, cmdFile);
102
+ if (fs.existsSync(srcCommand)) {
103
+ fs.copyFileSync(srcCommand, destCommand);
104
+ console.log(` [OK] Copied /${cmdFile.replace(".md", "")} command`);
99
105
  }
100
- fs.copyFileSync(srcCommand, destCommand);
101
- console.log(` [OK] Copied /minimax command`);
102
106
  }
103
107
 
104
108
  console.log("-- Installing dependencies...");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@miloya/oc-minimax-status",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "MiniMax Coding Plan 用量查询插件 for OpenCode - 一键安装自动配置",
5
5
  "main": "index.js",
6
6
  "type": "module",