@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxiaom/adoremix",
3
- "version": "1.0.46",
3
+ "version": "1.0.48",
4
4
  "description": "AdoreMix broadcast server - cross-platform installer, runner and service manager",
5
5
  "bin": {
6
6
  "adoremix": "./bin/adoremix.js"
@@ -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 { execFileSync('command -v ' + cmd + ' >/dev/null 2>&1', { stdio: 'ignore' }); return true; }
184
- catch (e) { return false; }
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';