@oxiaom/adoremix 1.0.46 → 1.0.48
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 +6 -6
package/package.json
CHANGED
package/tts/providers/audio8.js
CHANGED
|
@@ -174,14 +174,14 @@ const AUDIO8_HEALTH_URL = `http://127.0.0.1:${AUDIO8_DEFAULT_PORT}/v1/models`;
|
|
|
174
174
|
const AUDIO8_MODEL_DIR = '~/audio8_models/audio8-TTS-0.1B-ONNX-INT8';
|
|
175
175
|
|
|
176
176
|
// 包管理器嗅探(apt/dnf/yum/apk/pacman)
|
|
177
|
+
// 用 which 而非 command -v(Debian/Ubuntu 12+ 的 /bin/sh 没有 command 内建,且 PATH 不一定对)
|
|
177
178
|
function detectPkgMgr() {
|
|
178
|
-
function which(cmd) {
|
|
179
|
-
try { return execFileSync('command -v ' + cmd, { stdio: 'pipe', encoding: 'utf8' }).trim(); } catch (e) { return null; }
|
|
180
|
-
}
|
|
181
|
-
// 用 try/catch 区分 exit 0 vs 非 0(execFileSync 默认成功也抛错,绕过去)
|
|
182
179
|
function exists(cmd) {
|
|
183
|
-
try {
|
|
184
|
-
|
|
180
|
+
try {
|
|
181
|
+
const out = execSync('/bin/sh -c "which ' + cmd + ' 2>/dev/null || echo NOT_FOUND"', { encoding: 'utf8' });
|
|
182
|
+
const t = out.trim();
|
|
183
|
+
return t !== '' && t !== 'NOT_FOUND';
|
|
184
|
+
} catch (e) { return false; }
|
|
185
185
|
}
|
|
186
186
|
if (exists('apt-get')) return 'apt';
|
|
187
187
|
if (exists('dnf')) return 'dnf';
|