@oxiaom/adoremix 1.0.45 → 1.0.47
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/tts/providers/audio8.js +11 -7
package/package.json
CHANGED
package/tts/providers/audio8.js
CHANGED
|
@@ -175,14 +175,18 @@ const AUDIO8_MODEL_DIR = '~/audio8_models/audio8-TTS-0.1B-ONNX-INT8';
|
|
|
175
175
|
|
|
176
176
|
// 包管理器嗅探(apt/dnf/yum/apk/pacman)
|
|
177
177
|
function detectPkgMgr() {
|
|
178
|
-
|
|
179
|
-
|
|
178
|
+
// 用 shell 执行 command -v,输出非空即表示存在(避免 execFileSync 在 exit 0 也抛 raiseForStatus)
|
|
179
|
+
function exists(cmd) {
|
|
180
|
+
try {
|
|
181
|
+
const out = execSync('command -v ' + cmd, { stdio: ['pipe', 'ignore', 'ignore'], encoding: 'utf8' });
|
|
182
|
+
return out && out.trim().length > 0;
|
|
183
|
+
} catch (e) { return false; }
|
|
180
184
|
}
|
|
181
|
-
if (
|
|
182
|
-
if (
|
|
183
|
-
if (
|
|
184
|
-
if (
|
|
185
|
-
if (
|
|
185
|
+
if (exists('apt-get')) return 'apt';
|
|
186
|
+
if (exists('dnf')) return 'dnf';
|
|
187
|
+
if (exists('yum')) return 'yum';
|
|
188
|
+
if (exists('apk')) return 'apk';
|
|
189
|
+
if (exists('pacman')) return 'pacman';
|
|
186
190
|
return null;
|
|
187
191
|
}
|
|
188
192
|
|