@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.
- package/bin/init.js +12 -8
- 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
|
|
91
|
+
// Copy command files
|
|
92
92
|
const commandDir = getCommandDir();
|
|
93
|
-
|
|
94
|
-
|
|
93
|
+
|
|
94
|
+
if (!fs.existsSync(commandDir)) {
|
|
95
|
+
fs.mkdirSync(commandDir, { recursive: true });
|
|
96
|
+
}
|
|
95
97
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
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...");
|