@oxiaom/adoremix 1.0.46 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxiaom/adoremix",
3
- "version": "1.0.46",
3
+ "version": "1.0.47",
4
4
  "description": "AdoreMix broadcast server - cross-platform installer, runner and service manager",
5
5
  "bin": {
6
6
  "adoremix": "./bin/adoremix.js"
@@ -175,13 +175,12 @@ 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
- 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 默认成功也抛错,绕过去)
178
+ // shell 执行 command -v,输出非空即表示存在(避免 execFileSync 在 exit 0 也抛 raiseForStatus)
182
179
  function exists(cmd) {
183
- try { execFileSync('command -v ' + cmd + ' >/dev/null 2>&1', { stdio: 'ignore' }); return true; }
184
- catch (e) { return false; }
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; }
185
184
  }
186
185
  if (exists('apt-get')) return 'apt';
187
186
  if (exists('dnf')) return 'dnf';