@oxiaom/adoremix 1.0.48 → 1.0.49

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.48",
3
+ "version": "1.0.49",
4
4
  "description": "AdoreMix broadcast server - cross-platform installer, runner and service manager",
5
5
  "bin": {
6
6
  "adoremix": "./bin/adoremix.js"
@@ -298,12 +298,32 @@ function install(opts) {
298
298
  }
299
299
  }
300
300
 
301
- // git clone
302
- try {
303
- logger.log('=== 克隆 Audio8_TTS 仓库 ===');
304
- execSync(`mkdir -p ~/audio8 && if [ ! -d ~/audio8/.git ]; then git clone ${AUDIO8_REPO} ~/audio8_temp && mv ~/audio8_temp/* ~/audio8_temp/.[!.]* ~/audio8/ 2>/dev/null; rm -rf ~/audio8_temp; else cd ~/audio8 && git pull; fi`, { stdio: 'inherit', shell: '/bin/bash' });
305
- } catch (e) {
306
- logger.error('克隆失败: ' + e.message.slice(0, 200));
301
+ // git clone(带重试和国内镜像备选,github 在公司网常断)
302
+ const MIRRORS = [
303
+ AUDIO8_REPO, // 官方
304
+ 'https://ghproxy.cn/https://github.com/Audio8-AI/Audio8_TTS.git', // 国内代理
305
+ 'https://mirror.ghproxy.com/https://github.com/Audio8-AI/Audio8_TTS.git'
306
+ ];
307
+ let cloned = false;
308
+ for (let attempt = 1; attempt <= 2; attempt++) {
309
+ for (const url of MIRRORS) {
310
+ try {
311
+ logger.log(`=== 克隆 Audio8_TTS(第 ${attempt} 次尝试): ${url} ===`);
312
+ execSync(`rm -rf ~/audio8_temp && git clone --depth=1 "${url}" ~/audio8_temp 2>&1 | tail -3`, { stdio: 'inherit', shell: '/bin/bash' });
313
+ execSync(`sh -c "cd ~/audio8_temp && (shopt -s dotglob; mv -- * ~/audio8/ 2>/dev/null || true)"`, { stdio: 'inherit', shell: '/bin/bash' });
314
+ execSync('rm -rf ~/audio8_temp', { stdio: 'ignore', shell: '/bin/bash' });
315
+ cloned = true;
316
+ break;
317
+ } catch (e) {
318
+ logger.warn(`克隆失败(${url.slice(0, 60)}...): ${String(e.message).slice(0, 100)}`);
319
+ }
320
+ }
321
+ if (cloned) break;
322
+ execSync('sleep 5', { stdio: 'ignore', shell: '/bin/bash' });
323
+ }
324
+ if (!cloned) {
325
+ logger.error('所有镜像和重试都失败,无法克隆 Audio8_TTS 仓库');
326
+ logger.warn('解决:手动在 ~/audio8 下放好 Audio8_TTS 源码再重试 install(跳过 git clone 步骤)');
307
327
  return 1;
308
328
  }
309
329