zen-gitsync 2.10.21 → 2.10.24

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.
@@ -6,10 +6,10 @@
6
6
  <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
7
7
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
8
8
  <title>Zen GitSync</title>
9
- <script type="module" crossorigin src="/assets/index-OJy1G6pO.js"></script>
10
- <link rel="modulepreload" crossorigin href="/assets/vendor-BpNfZzQX.js">
9
+ <script type="module" crossorigin src="/assets/index-b9vh2ATa.js"></script>
10
+ <link rel="modulepreload" crossorigin href="/assets/vendor-DrABRxF7.js">
11
11
  <link rel="stylesheet" crossorigin href="/assets/vendor-DpSHka1A.css">
12
- <link rel="stylesheet" crossorigin href="/assets/index-izOobFz3.css">
12
+ <link rel="stylesheet" crossorigin href="/assets/index-D_n92IoC.css">
13
13
  </head>
14
14
  <body>
15
15
  <div id="app"></div>
@@ -644,7 +644,7 @@ export function registerConfigRoutes({
644
644
  }
645
645
  })
646
646
 
647
- // 保存“一键推送成功后启动项”
647
+ // 保存"一键推送成功后启动项"
648
648
  app.post('/api/config/save-after-quick-push-action', express.json(), async (req, res) => {
649
649
  try {
650
650
  const { afterQuickPushAction } = req.body
@@ -670,4 +670,28 @@ export function registerConfigRoutes({
670
670
  res.status(500).json({ success: false, error: error.message })
671
671
  }
672
672
  })
673
+
674
+ // 保存通用设置(主题和语言)
675
+ app.post('/api/config/save-general-settings', express.json(), async (req, res) => {
676
+ try {
677
+ const { theme, locale } = req.body
678
+
679
+ // 读取原始配置以保留项目设置
680
+ const rawConfig = await configManager.readRawConfigFile()
681
+
682
+ // 更新全局设置
683
+ if (theme && ['light', 'dark', 'auto'].includes(theme)) {
684
+ rawConfig.theme = theme
685
+ }
686
+ if (locale && ['zh-CN', 'en-US'].includes(locale)) {
687
+ rawConfig.locale = locale
688
+ }
689
+
690
+ // 直接写入原始配置,避免覆盖项目设置
691
+ await configManager.writeRawConfigFile(rawConfig)
692
+ res.json({ success: true })
693
+ } catch (error) {
694
+ res.status(500).json({ success: false, error: error.message })
695
+ }
696
+ })
673
697
  }
@@ -344,11 +344,17 @@ export function registerGitOpsRoutes({
344
344
  res.json({ success: true, message: stdout });
345
345
  } catch (error) {
346
346
  // 改进错误处理,检查是否需要合并
347
- const errorMsg = error.message || '';
348
- const needsMerge = errorMsg.includes('merge') ||
349
- errorMsg.includes('需要合并') ||
350
- errorMsg.includes('CONFLICT') ||
351
- errorMsg.includes('冲突');
347
+ // 合并冲突信息可能在 message stderr 中
348
+ const errorMsg = (error.message || '').toLowerCase();
349
+ const stderrMsg = (error.stderr || '').toLowerCase();
350
+ const stdoutMsg = (error.stdout || '').toLowerCase();
351
+ const fullOutput = errorMsg + ' ' + stderrMsg + ' ' + stdoutMsg;
352
+
353
+ const needsMerge = fullOutput.includes('merge') ||
354
+ fullOutput.includes('需要合并') ||
355
+ fullOutput.includes('conflict') ||
356
+ fullOutput.includes('冲突') ||
357
+ fullOutput.includes('automatic merge failed');
352
358
 
353
359
  // 返回更详细的错误信息和标记
354
360
  res.status(500).json({
@@ -350,6 +350,9 @@ function execGitCommand(command, options = {}) {
350
350
  const currentTime = new Date().toLocaleString('zh-CN', { hour12: false });
351
351
  console.log(chalk.dim(`📁 目录: ${cwd} | ⏰ 时间: ${currentTime}`));
352
352
  }
353
+ // 将 stdout 和 stderr 附加到 error 对象,以便上层可以获取完整输出
354
+ error.stdout = stdout
355
+ error.stderr = stderr
353
356
  reject(error)
354
357
  return
355
358
  }
@@ -462,12 +465,12 @@ File Locking:
462
465
  --cmd="your-cmd" Execute custom cmd command (immediately, at a time, or periodically)
463
466
  --cmd-interval=<seconds> Execute custom cmd every N seconds
464
467
  --at="HH:MM" Execute custom cmd at a specific time (today) or --at="YYYY-MM-DD HH:MM:SS"
465
- --daily Repeat with --at every day at the same time
468
+ --daily Repeat with --at every day at the same time
466
469
 
467
470
  Example:
468
471
  g --cmd="echo hello" --cmd-interval=5 # 每5秒执行一次echo hello
469
472
  g --cmd="echo at-time" --at=23:59 # 在23:59执行一次echo at-time
470
- g --cmd="echo daily" --at=23:59 --daily # 每天23:59执行一次echo daily
473
+ g --cmd="echo daily" --at=23:59 --daily # 每天23:59执行一次echo daily
471
474
  g --cmd="echo now" # 立即执行一次echo now
472
475
  g --cmd="echo hi" --cmd-interval=10 --interval=60 # cmd和git自动提交并行
473
476
  g -m "Initial commit" Commit with a custom message