@hugo.bastidas/minimax-plugin 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.
- package/package.json +1 -1
- package/scripts/install.mjs +7 -3
package/package.json
CHANGED
package/scripts/install.mjs
CHANGED
|
@@ -28,7 +28,7 @@ import { writeShellAlias, removeShellAlias, isShellAliasInstalled, isLegacyAlias
|
|
|
28
28
|
import { existsSync, mkdirSync, readFileSync } from 'node:fs';
|
|
29
29
|
import { homedir } from 'node:os';
|
|
30
30
|
import { join, dirname } from 'node:path';
|
|
31
|
-
import { execSync } from 'node:child_process';
|
|
31
|
+
import { execSync, execFileSync } from 'node:child_process';
|
|
32
32
|
|
|
33
33
|
const CLAUDE_CONFIG_PATH = join(homedir(), '.claude.json');
|
|
34
34
|
const CLAUDE_SETTINGS_PATH = join(homedir(), '.claude', 'settings.json');
|
|
@@ -61,7 +61,7 @@ function getClaudeHookPath() {
|
|
|
61
61
|
|
|
62
62
|
function commandExists(command) {
|
|
63
63
|
try {
|
|
64
|
-
|
|
64
|
+
execFileSync('which', [command], { stdio: 'ignore' });
|
|
65
65
|
return true;
|
|
66
66
|
} catch {
|
|
67
67
|
return false;
|
|
@@ -70,7 +70,7 @@ function commandExists(command) {
|
|
|
70
70
|
|
|
71
71
|
function safeCommandVersion(command, args = ['--version']) {
|
|
72
72
|
try {
|
|
73
|
-
return
|
|
73
|
+
return execFileSync(command, args, { encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'] }).trim() || 'installed';
|
|
74
74
|
} catch {
|
|
75
75
|
return commandExists(command) ? 'installed' : 'missing';
|
|
76
76
|
}
|
|
@@ -280,6 +280,10 @@ function ensurePluginLinked() {
|
|
|
280
280
|
const pluginRoot = join(import.meta.dirname ?? '.', '..');
|
|
281
281
|
const cliDist = join(pluginRoot, 'dist', 'cli.js');
|
|
282
282
|
if (!existsSync(cliDist)) return;
|
|
283
|
+
if (commandExists('minimax') && commandExists('minimax-plugin')) {
|
|
284
|
+
console.log('minimax CLI already available globally, skipping npm link');
|
|
285
|
+
return;
|
|
286
|
+
}
|
|
283
287
|
try {
|
|
284
288
|
execSync('npm link', { stdio: 'inherit', cwd: pluginRoot });
|
|
285
289
|
console.log('Linked minimax CLI globally (minimax gain available from any folder)');
|