mix-id 1.0.0 ā 1.0.1
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/cli.mjs +28 -2
- package/package.json +1 -1
package/cli.mjs
CHANGED
|
@@ -67,11 +67,37 @@ if (!input || flags.help) {
|
|
|
67
67
|
|
|
68
68
|
// --- Preflight checks ---
|
|
69
69
|
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
async function ensureDeps() {
|
|
71
|
+
const missing = [];
|
|
72
|
+
if (!hasCommand('ffmpeg') || !hasCommand('ffprobe')) missing.push('ffmpeg');
|
|
73
|
+
if (isURL && !hasCommand('yt-dlp')) missing.push('yt-dlp');
|
|
74
|
+
|
|
75
|
+
if (missing.length === 0) return;
|
|
76
|
+
|
|
77
|
+
// Try auto-install via brew
|
|
78
|
+
if (hasCommand('brew')) {
|
|
79
|
+
console.log(`\nš¦ Installing missing dependencies: ${missing.join(', ')}...\n`);
|
|
80
|
+
const { execSync } = await import('child_process');
|
|
81
|
+
try {
|
|
82
|
+
execSync(`brew install ${missing.join(' ')}`, { stdio: 'inherit' });
|
|
83
|
+
console.log('');
|
|
84
|
+
return;
|
|
85
|
+
} catch {
|
|
86
|
+
console.error(`\nā Auto-install failed. Please run manually:`);
|
|
87
|
+
console.error(` brew install ${missing.join(' ')}`);
|
|
88
|
+
process.exit(1);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
console.error(`\nā Missing dependencies: ${missing.join(', ')}`);
|
|
93
|
+
console.error(`\n Install with:`);
|
|
94
|
+
console.error(` brew install ${missing.join(' ')} (macOS)`);
|
|
95
|
+
console.error(` apt install ${missing.join(' ')} (Linux)`);
|
|
72
96
|
process.exit(1);
|
|
73
97
|
}
|
|
74
98
|
|
|
99
|
+
await ensureDeps();
|
|
100
|
+
|
|
75
101
|
// --- Resolve input ---
|
|
76
102
|
|
|
77
103
|
const isURL = /^https?:\/\//i.test(input);
|