zen-gitsync 2.11.7 → 2.11.9

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.
@@ -10,10 +10,10 @@
10
10
  <link rel="preconnect" href="https://fonts.googleapis.com" />
11
11
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
12
12
  <link href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet" />
13
- <script type="module" crossorigin src="/assets/index-CCP21wC3.js"></script>
14
- <link rel="modulepreload" crossorigin href="/assets/vendor-BSAE54oX.js">
15
- <link rel="stylesheet" crossorigin href="/assets/vendor-COoKXBNX.css">
16
- <link rel="stylesheet" crossorigin href="/assets/index-DTMhEG-O.css">
13
+ <script type="module" crossorigin src="/assets/index-BDh-3jqo.js"></script>
14
+ <link rel="modulepreload" crossorigin href="/assets/vendor-BtihdyTS.js">
15
+ <link rel="stylesheet" crossorigin href="/assets/vendor-CeElb63i.css">
16
+ <link rel="stylesheet" crossorigin href="/assets/index-BMlnIJ-P.css">
17
17
  </head>
18
18
  <body>
19
19
  <div id="app"></div>
@@ -1021,6 +1021,35 @@ export function registerGitOpsRoutes({
1021
1021
  }
1022
1022
  });
1023
1023
 
1024
+ // 初始化Git仓库
1025
+ app.post('/api/git-init', async (req, res) => {
1026
+ try {
1027
+ const { stdout } = await execGitCommand('git init');
1028
+ res.json({ success: true, output: stdout.trim() });
1029
+ } catch (error) {
1030
+ console.error('git init 失败:', error);
1031
+ res.json({ success: false, error: error.message || 'git init 失败' });
1032
+ }
1033
+ });
1034
+
1035
+ // 添加远程仓库的API
1036
+ app.post('/api/add-remote', express.json(), async (req, res) => {
1037
+ try {
1038
+ if (!getIsGitRepo()) {
1039
+ return res.json({ success: false, error: '当前目录不是Git仓库' });
1040
+ }
1041
+ const { name = 'origin', url } = req.body;
1042
+ if (!url || !url.trim()) {
1043
+ return res.json({ success: false, error: '远程仓库地址不能为空' });
1044
+ }
1045
+ await execGitCommand(`git remote add ${name} ${url.trim()}`);
1046
+ res.json({ success: true });
1047
+ } catch (error) {
1048
+ console.error('添加远程仓库失败:', error);
1049
+ res.json({ success: false, error: error.message || '添加远程仓库失败' });
1050
+ }
1051
+ });
1052
+
1024
1053
  // 获取远程仓库URL的API
1025
1054
  app.get('/api/remote-url', async (req, res) => {
1026
1055
  try {