@oxiaom/adoremix 1.0.47 → 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 +4 -3
package/package.json
CHANGED
package/tts/providers/audio8.js
CHANGED
|
@@ -174,12 +174,13 @@ 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
|
-
// 用 shell 执行 command -v,输出非空即表示存在(避免 execFileSync 在 exit 0 也抛 raiseForStatus)
|
|
179
179
|
function exists(cmd) {
|
|
180
180
|
try {
|
|
181
|
-
const out = execSync('
|
|
182
|
-
|
|
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';
|
|
183
184
|
} catch (e) { return false; }
|
|
184
185
|
}
|
|
185
186
|
if (exists('apt-get')) return 'apt';
|