@done-coding/cli-git 0.6.14-alpha.3 → 0.6.15
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/README.md +40 -22
- package/es/cli.mjs +2 -2
- package/es/helpers.mjs +1 -1
- package/es/{index-488dfda2.js → index-569e0691.js} +37 -37
- package/es/{index-6257eade.js → index-d0f82826.js} +1 -1
- package/es/index.mjs +2 -2
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -8,6 +8,7 @@ git 跨平台操作命令行工具 - 提供 git 平台克隆、钩子管理和
|
|
|
8
8
|
## 安装
|
|
9
9
|
|
|
10
10
|
### 独立安装
|
|
11
|
+
|
|
11
12
|
```bash
|
|
12
13
|
npm install @done-coding/cli-git
|
|
13
14
|
# 或
|
|
@@ -15,6 +16,7 @@ pnpm add @done-coding/cli-git
|
|
|
15
16
|
```
|
|
16
17
|
|
|
17
18
|
### 作为 done-coding CLI 的一部分
|
|
19
|
+
|
|
18
20
|
```bash
|
|
19
21
|
npm install -g @done-coding/cli
|
|
20
22
|
# 然后使用
|
|
@@ -45,6 +47,7 @@ dc git --help # Windows
|
|
|
45
47
|
### 基础命令
|
|
46
48
|
|
|
47
49
|
#### `dc-git init`
|
|
50
|
+
|
|
48
51
|
初始化配置文件
|
|
49
52
|
|
|
50
53
|
```bash
|
|
@@ -53,6 +56,7 @@ dc-git init
|
|
|
53
56
|
```
|
|
54
57
|
|
|
55
58
|
#### `dc-git clone <platform> <username>`
|
|
59
|
+
|
|
56
60
|
从指定的 git 平台克隆用户的代码仓库
|
|
57
61
|
|
|
58
62
|
```bash
|
|
@@ -67,10 +71,12 @@ dc-git clone bitbucket username
|
|
|
67
71
|
```
|
|
68
72
|
|
|
69
73
|
**参数说明**:
|
|
74
|
+
|
|
70
75
|
- `platform`: git 平台名称 (github, gitlab, bitbucket 等)
|
|
71
76
|
- `username`: 用户名
|
|
72
77
|
|
|
73
78
|
#### `dc-git hooks <name> [args...]`
|
|
79
|
+
|
|
74
80
|
执行 git 钩子回调
|
|
75
81
|
|
|
76
82
|
```bash
|
|
@@ -85,10 +91,12 @@ dc-git hooks pre-push origin main
|
|
|
85
91
|
```
|
|
86
92
|
|
|
87
93
|
**参数说明**:
|
|
94
|
+
|
|
88
95
|
- `name`: 钩子名称
|
|
89
96
|
- `args`: 传递给钩子的参数
|
|
90
97
|
|
|
91
98
|
#### `dc-git check <type>`
|
|
99
|
+
|
|
92
100
|
检查 git 操作和状态,主要为工程化配置提供支持
|
|
93
101
|
|
|
94
102
|
```bash
|
|
@@ -97,6 +105,7 @@ dc-git check reverse-merge
|
|
|
97
105
|
```
|
|
98
106
|
|
|
99
107
|
**参数说明**:
|
|
108
|
+
|
|
100
109
|
- `type`: 检查类型
|
|
101
110
|
- `reverse-merge`: 检测反向合并,防止高级分支被合并到低级分支
|
|
102
111
|
|
|
@@ -154,29 +163,29 @@ DC git check reverse-merge
|
|
|
154
163
|
```javascript
|
|
155
164
|
export default {
|
|
156
165
|
// 默认平台
|
|
157
|
-
defaultPlatform:
|
|
158
|
-
|
|
166
|
+
defaultPlatform: "github",
|
|
167
|
+
|
|
159
168
|
// 克隆配置
|
|
160
169
|
clone: {
|
|
161
170
|
// 默认克隆协议
|
|
162
|
-
protocol:
|
|
171
|
+
protocol: "https", // 或 'ssh'
|
|
163
172
|
// 目标目录
|
|
164
|
-
targetDir:
|
|
173
|
+
targetDir: "./repos",
|
|
165
174
|
},
|
|
166
|
-
|
|
175
|
+
|
|
167
176
|
// 钩子配置
|
|
168
177
|
hooks: {
|
|
169
178
|
// 启用的钩子
|
|
170
|
-
enabled: [
|
|
179
|
+
enabled: ["pre-commit", "post-commit", "pre-push"],
|
|
171
180
|
// 钩子脚本路径
|
|
172
|
-
scriptsPath:
|
|
181
|
+
scriptsPath: "./.git/hooks",
|
|
173
182
|
},
|
|
174
|
-
|
|
183
|
+
|
|
175
184
|
// 检查配置
|
|
176
185
|
check: {
|
|
177
186
|
// 默认检查项
|
|
178
|
-
defaultChecks: [
|
|
179
|
-
}
|
|
187
|
+
defaultChecks: ["status", "branch", "remote"],
|
|
188
|
+
},
|
|
180
189
|
};
|
|
181
190
|
```
|
|
182
191
|
|
|
@@ -185,29 +194,33 @@ export default {
|
|
|
185
194
|
### 作为模块使用
|
|
186
195
|
|
|
187
196
|
```javascript
|
|
188
|
-
import { GitHelper } from
|
|
197
|
+
import { GitHelper } from "@done-coding/cli-git/helpers";
|
|
189
198
|
|
|
190
199
|
const git = new GitHelper();
|
|
191
200
|
|
|
192
201
|
// 克隆仓库
|
|
193
|
-
await git.cloneFromPlatform(
|
|
202
|
+
await git.cloneFromPlatform("github", "username");
|
|
194
203
|
|
|
195
204
|
// 执行钩子
|
|
196
|
-
await git.executeHook(
|
|
205
|
+
await git.executeHook("pre-commit", []);
|
|
197
206
|
|
|
198
207
|
// 检查状态
|
|
199
|
-
const status = await git.checkStatus(
|
|
208
|
+
const status = await git.checkStatus("status");
|
|
200
209
|
console.log(status);
|
|
201
210
|
```
|
|
202
211
|
|
|
203
212
|
### TypeScript 支持
|
|
204
213
|
|
|
205
214
|
```typescript
|
|
206
|
-
import type {
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
215
|
+
import type {
|
|
216
|
+
PlatformType,
|
|
217
|
+
HookType,
|
|
218
|
+
CheckType,
|
|
219
|
+
} from "@done-coding/cli-git/helpers";
|
|
220
|
+
|
|
221
|
+
const platform: PlatformType = "github";
|
|
222
|
+
const hook: HookType = "pre-commit";
|
|
223
|
+
const checkType: CheckType = "status";
|
|
211
224
|
```
|
|
212
225
|
|
|
213
226
|
## 故障排除
|
|
@@ -215,6 +228,7 @@ const checkType: CheckType = 'status';
|
|
|
215
228
|
### 常见问题
|
|
216
229
|
|
|
217
230
|
**Q: 克隆失败**
|
|
231
|
+
|
|
218
232
|
```bash
|
|
219
233
|
# 检查网络连接
|
|
220
234
|
ping github.com
|
|
@@ -227,6 +241,7 @@ dc-git clone github username --verbose
|
|
|
227
241
|
```
|
|
228
242
|
|
|
229
243
|
**Q: 钩子执行失败**
|
|
244
|
+
|
|
230
245
|
```bash
|
|
231
246
|
# 检查钩子文件权限
|
|
232
247
|
ls -la .git/hooks/
|
|
@@ -239,6 +254,7 @@ dc-git init
|
|
|
239
254
|
```
|
|
240
255
|
|
|
241
256
|
**Q: 检查命令无响应**
|
|
257
|
+
|
|
242
258
|
```bash
|
|
243
259
|
# 确保在 git 仓库中
|
|
244
260
|
git status
|
|
@@ -277,7 +293,7 @@ DEBUG=done-coding:git dc-git clone github username
|
|
|
277
293
|
|
|
278
294
|
```bash
|
|
279
295
|
# 克隆仓库
|
|
280
|
-
git clone https://
|
|
296
|
+
git clone https://github.com/done-coding/done-coding-cli.git
|
|
281
297
|
cd done-coding-cli/packages/git
|
|
282
298
|
|
|
283
299
|
# 安装依赖
|
|
@@ -313,6 +329,7 @@ MIT © [JustSoSu](https://gitee.com/done-coding)
|
|
|
313
329
|
### 检测功能详解
|
|
314
330
|
|
|
315
331
|
#### `dc-git check reverse-merge`
|
|
332
|
+
|
|
316
333
|
专为工程化配置提供的 git 合并规范检测:
|
|
317
334
|
|
|
318
335
|
```bash
|
|
@@ -321,12 +338,13 @@ dc-git check reverse-merge
|
|
|
321
338
|
|
|
322
339
|
# 该命令会检测:
|
|
323
340
|
# 1. 通过 git reflog 检测合并操作
|
|
324
|
-
# 2. 通过提交信息检测合并记录
|
|
341
|
+
# 2. 通过提交信息检测合并记录
|
|
325
342
|
# 3. 通过提交记录检测历史合并
|
|
326
343
|
# 4. 检测 rebase 操作的合规性
|
|
327
344
|
```
|
|
328
345
|
|
|
329
346
|
**检测场景**:
|
|
347
|
+
|
|
330
348
|
- 防止 `main` 分支被合并到 `feature` 分支
|
|
331
349
|
- 防止 `develop` 分支被合并到个人开发分支
|
|
332
350
|
- 确保分支合并方向符合 Git Flow 规范
|
|
@@ -336,4 +354,4 @@ dc-git check reverse-merge
|
|
|
336
354
|
- [主 CLI 工具](https://www.npmjs.com/package/@done-coding/cli)
|
|
337
355
|
- [配置工具包](https://www.npmjs.com/package/@done-coding/cli-config) - 使用本包的检测功能
|
|
338
356
|
- [Gitee 仓库](https://gitee.com/done-coding/done-coding-cli)
|
|
339
|
-
- [更新日志](./CHANGELOG.md)
|
|
357
|
+
- [更新日志](./CHANGELOG.md)
|
package/es/cli.mjs
CHANGED
package/es/helpers.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { g as s, G as n, a as i, h as m } from "./index-
|
|
2
|
+
import { g as s, G as n, a as i, h as m } from "./index-569e0691.js";
|
|
3
3
|
import { outputConsole as o, xPrompts as r } from "@done-coding/cli-utils";
|
|
4
4
|
import "node:fs";
|
|
5
5
|
import "node:path";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { lookForParentTarget as Y, outputConsole as i, decryptAES as Z, encryptAES as W, xPrompts as
|
|
2
|
+
import { lookForParentTarget as Y, outputConsole as i, decryptAES as Z, encryptAES as W, xPrompts as d, HooksNameEnum as p, addHuskyHooks as ee, initHandlerCommon as te, getConfigFileCommonOptions as I, execSyncHijack as N, readConfigFile as R, getCurrentBranchName as se, getCommitByHookName as oe, resolveMergeInfoByGitReflogAction as re, checkCurrentIsRebasing as ne, resolveMergeInfoByCommitMsg as ce, getCurrentBranchLastCommitList as ae, getLastReflogList as ie, createSubcommand as ge, getRootScriptName as me } from "@done-coding/cli-utils";
|
|
3
3
|
import _ from "node:fs";
|
|
4
4
|
import w from "node:path";
|
|
5
5
|
import { createRequest as L } from "@done-coding/request-axios";
|
|
6
6
|
import pe from "axios";
|
|
7
|
-
var
|
|
8
|
-
const
|
|
9
|
-
timeout:
|
|
7
|
+
var l = /* @__PURE__ */ ((e) => (e.INIT = "init", e.CLONE = "clone", e.HOOKS = "hooks", e.CHECK = "check", e))(l || {}), h = /* @__PURE__ */ ((e) => (e.DEFAULT = "default", e.CLONE_CONFIG = "cloneConfig", e))(h || {}), E = /* @__PURE__ */ ((e) => (e.GITHUB = "github", e.GITEE = "gitee", e))(E || {}), C = /* @__PURE__ */ ((e) => (e.REVERSE_MERGE = "reverseMerge", e))(C || {}), u = /* @__PURE__ */ ((e) => (e.REFLOG_ACTION = "reflog-action", e.COMMIT_MSG = "commit-msg", e.COMMIT_RECORD = "commit-record", e.PRE_REBASE = "pre-rebase", e))(u || {});
|
|
8
|
+
const fe = 3e4, y = Math.random(), U = {
|
|
9
|
+
timeout: fe,
|
|
10
10
|
getBusinessCode() {
|
|
11
11
|
return y;
|
|
12
12
|
},
|
|
@@ -24,7 +24,7 @@ const le = 3e4, y = Math.random(), U = {
|
|
|
24
24
|
}), A = L({
|
|
25
25
|
basePath: "https://api.github.com",
|
|
26
26
|
...U
|
|
27
|
-
}),
|
|
27
|
+
}), le = ({
|
|
28
28
|
username: e
|
|
29
29
|
}) => x({
|
|
30
30
|
url: `/api/v5/users/${e}/repos`,
|
|
@@ -45,7 +45,7 @@ const le = 3e4, y = Math.random(), U = {
|
|
|
45
45
|
}) => A({
|
|
46
46
|
url: `/users/${e}/repos`,
|
|
47
47
|
method: "GET"
|
|
48
|
-
}),
|
|
48
|
+
}), de = ({
|
|
49
49
|
accessToken: e
|
|
50
50
|
}) => A({
|
|
51
51
|
url: "/user/repos",
|
|
@@ -60,7 +60,7 @@ const le = 3e4, y = Math.random(), U = {
|
|
|
60
60
|
}
|
|
61
61
|
}), T = {
|
|
62
62
|
name: "@done-coding/cli-git",
|
|
63
|
-
version: "0.6.
|
|
63
|
+
version: "0.6.15",
|
|
64
64
|
description: "git跨平台操作命令行工具",
|
|
65
65
|
bin: {
|
|
66
66
|
"dc-git": "es/cli.mjs"
|
|
@@ -70,8 +70,8 @@ const le = 3e4, y = Math.random(), U = {
|
|
|
70
70
|
moduleName: "git"
|
|
71
71
|
}
|
|
72
72
|
}, {
|
|
73
|
-
cliConfig: { namespaceDir:
|
|
74
|
-
} = T, H = `./${
|
|
73
|
+
cliConfig: { namespaceDir: he, moduleName: Re }
|
|
74
|
+
} = T, H = `./${he}/${Re}`, S = `${H}.json`, F = (e) => `${H}/.${e}`, D = ({ platform: e, username: t }) => `${e}/${t}`, Me = (e) => {
|
|
75
75
|
const { platform: t } = e, s = F(t), r = Y(s, {
|
|
76
76
|
isFindFarthest: !1
|
|
77
77
|
});
|
|
@@ -93,10 +93,10 @@ const le = 3e4, y = Math.random(), U = {
|
|
|
93
93
|
}) => {
|
|
94
94
|
const o = F(s), n = JSON.stringify({
|
|
95
95
|
accessToken: r
|
|
96
|
-
}), g = D({ platform: s, username: t }),
|
|
96
|
+
}), g = D({ platform: s, username: t }), f = W({ text: n, secretKey: g }), a = w.join(e, o);
|
|
97
97
|
_.mkdirSync(w.dirname(a), {
|
|
98
98
|
recursive: !0
|
|
99
|
-
}), _.writeFileSync(a,
|
|
99
|
+
}), _.writeFileSync(a, f, "utf-8"), i.success(`配置信息保存成功 ${a}`);
|
|
100
100
|
}, B = [
|
|
101
101
|
{ title: "GitHub", value: E.GITHUB },
|
|
102
102
|
{ title: "Gitee", value: E.GITEE }
|
|
@@ -136,7 +136,7 @@ const le = 3e4, y = Math.random(), U = {
|
|
|
136
136
|
platform: e,
|
|
137
137
|
username: t
|
|
138
138
|
};
|
|
139
|
-
e || (s.platform = (await
|
|
139
|
+
e || (s.platform = (await d(v())).platform), t || (s.username = (await d(K())).username);
|
|
140
140
|
const { platform: r, username: o } = s;
|
|
141
141
|
let c = [];
|
|
142
142
|
const n = Me({
|
|
@@ -145,13 +145,13 @@ const le = 3e4, y = Math.random(), U = {
|
|
|
145
145
|
});
|
|
146
146
|
let g = n == null ? void 0 : n.accessToken;
|
|
147
147
|
i.stage(`正在获取${o}的${r}仓库列表...`);
|
|
148
|
-
const
|
|
148
|
+
const f = {
|
|
149
149
|
username: o,
|
|
150
150
|
accessToken: g
|
|
151
151
|
};
|
|
152
152
|
switch (s.platform) {
|
|
153
153
|
case E.GITHUB: {
|
|
154
|
-
c = (await (
|
|
154
|
+
c = (await (f.accessToken ? de : Ee)(f)).data.map((m) => ({
|
|
155
155
|
name: m.name,
|
|
156
156
|
httpUrl: m.clone_url,
|
|
157
157
|
sshUrl: m.ssh_url,
|
|
@@ -160,7 +160,7 @@ const le = 3e4, y = Math.random(), U = {
|
|
|
160
160
|
break;
|
|
161
161
|
}
|
|
162
162
|
case E.GITEE: {
|
|
163
|
-
c = (await (
|
|
163
|
+
c = (await (f.accessToken ? ue : le)(f)).data.map((m) => ({
|
|
164
164
|
name: m.name,
|
|
165
165
|
httpUrl: m.html_url,
|
|
166
166
|
sshUrl: m.ssh_url,
|
|
@@ -176,7 +176,7 @@ const le = 3e4, y = Math.random(), U = {
|
|
|
176
176
|
return;
|
|
177
177
|
} else
|
|
178
178
|
i.stage(`共${c.length}个仓库`);
|
|
179
|
-
const { repoUrl: a } = await
|
|
179
|
+
const { repoUrl: a } = await d({
|
|
180
180
|
name: "repoUrl",
|
|
181
181
|
type: "select",
|
|
182
182
|
message: "选择仓库",
|
|
@@ -203,7 +203,7 @@ const le = 3e4, y = Math.random(), U = {
|
|
|
203
203
|
p.PRE_REBASE
|
|
204
204
|
], $ = (e) => {
|
|
205
205
|
const {
|
|
206
|
-
[
|
|
206
|
+
[l.CHECK]: { [C.REVERSE_MERGE]: t }
|
|
207
207
|
} = e;
|
|
208
208
|
return t;
|
|
209
209
|
}, Te = (e) => Math.max(
|
|
@@ -213,7 +213,7 @@ const le = 3e4, y = Math.random(), U = {
|
|
|
213
213
|
(s, [r, { afterHash: o, logCount: c }]) => {
|
|
214
214
|
let n = c - 1;
|
|
215
215
|
if (o) {
|
|
216
|
-
const g = t.findIndex((
|
|
216
|
+
const g = t.findIndex((f) => f.hash === o);
|
|
217
217
|
g !== -1 && (i.info(
|
|
218
218
|
`${r} 设置 只检测 ${o} 之后的日志 即 下标 [0 - ${g})`
|
|
219
219
|
), n = Math.min(n, g - 1));
|
|
@@ -240,7 +240,7 @@ const le = 3e4, y = Math.random(), U = {
|
|
|
240
240
|
);
|
|
241
241
|
return n || i.skip(`跳过: 允许${r} => ${o}`), n;
|
|
242
242
|
}, Ge = {
|
|
243
|
-
[
|
|
243
|
+
[l.CHECK]: {
|
|
244
244
|
[C.REVERSE_MERGE]: {
|
|
245
245
|
[/^test$/.source]: {
|
|
246
246
|
includeRebase: !0,
|
|
@@ -256,15 +256,15 @@ const le = 3e4, y = Math.random(), U = {
|
|
|
256
256
|
type: {
|
|
257
257
|
alias: "t",
|
|
258
258
|
describe: "初始化类型",
|
|
259
|
-
choices: [
|
|
260
|
-
default:
|
|
259
|
+
choices: [h.DEFAULT, h.CLONE_CONFIG],
|
|
260
|
+
default: h.DEFAULT
|
|
261
261
|
}
|
|
262
262
|
}), ke = (e) => {
|
|
263
263
|
N(`npm pkg set scripts.postprepare="${e} init"`);
|
|
264
264
|
}, j = async (e) => {
|
|
265
265
|
const { type: t } = e;
|
|
266
266
|
switch (t) {
|
|
267
|
-
case
|
|
267
|
+
case h.DEFAULT: {
|
|
268
268
|
const { rootDir: s, isSubCommand: r, _: o } = e, c = `${e.$0}${r ? ` ${o[0]}` : ""}`;
|
|
269
269
|
return await ee({
|
|
270
270
|
hookNames: Ie,
|
|
@@ -276,8 +276,8 @@ const le = 3e4, y = Math.random(), U = {
|
|
|
276
276
|
}
|
|
277
277
|
});
|
|
278
278
|
}
|
|
279
|
-
case
|
|
280
|
-
const { rootDir: s } = e, { platform: r } = await
|
|
279
|
+
case h.CLONE_CONFIG: {
|
|
280
|
+
const { rootDir: s } = e, { platform: r } = await d(v()), { username: o } = await d(K()), { accessToken: c } = await d($e);
|
|
281
281
|
return Ce({
|
|
282
282
|
rootDir: s,
|
|
283
283
|
platform: r,
|
|
@@ -289,7 +289,7 @@ const le = 3e4, y = Math.random(), U = {
|
|
|
289
289
|
throw new Error(`未知的初始化类型: ${t}`);
|
|
290
290
|
}
|
|
291
291
|
}, be = {
|
|
292
|
-
command:
|
|
292
|
+
command: l.INIT,
|
|
293
293
|
describe: "初始化配置文件",
|
|
294
294
|
options: Pe(),
|
|
295
295
|
handler: j
|
|
@@ -316,7 +316,7 @@ const le = 3e4, y = Math.random(), U = {
|
|
|
316
316
|
{ stdio: "inherit" }
|
|
317
317
|
), i.success(`克隆${t}成功`);
|
|
318
318
|
}, Be = {
|
|
319
|
-
command: `${
|
|
319
|
+
command: `${l.CLONE} <platform> <username>`,
|
|
320
320
|
describe: "从选择的git平台克隆代码",
|
|
321
321
|
options: we(),
|
|
322
322
|
positionals: ye(),
|
|
@@ -369,7 +369,7 @@ const le = 3e4, y = Math.random(), U = {
|
|
|
369
369
|
configMap: c,
|
|
370
370
|
currentBranch: t
|
|
371
371
|
})) {
|
|
372
|
-
const { fromBranch: g, toBranch:
|
|
372
|
+
const { fromBranch: g, toBranch: f = t } = o, a = `禁止${g}被合并: ${g} => ${f}
|
|
373
373
|
|
|
374
374
|
--------- 建议 ---------
|
|
375
375
|
可以通过
|
|
@@ -387,7 +387,7 @@ const le = 3e4, y = Math.random(), U = {
|
|
|
387
387
|
const s = $(e), r = Te(s);
|
|
388
388
|
if (!r)
|
|
389
389
|
return;
|
|
390
|
-
const o = ae({ count: r }), c = Se(s, o), n = o.map((a) => a.hash),
|
|
390
|
+
const o = ae({ count: r }), c = Se(s, o), n = o.map((a) => a.hash), f = ie({
|
|
391
391
|
/** 考虑reflog存在往复切换 */
|
|
392
392
|
count: r + 30,
|
|
393
393
|
filterItem: (a) => n.includes(a.hash)
|
|
@@ -397,7 +397,7 @@ const le = 3e4, y = Math.random(), U = {
|
|
|
397
397
|
);
|
|
398
398
|
o.forEach((a, m) => {
|
|
399
399
|
var P;
|
|
400
|
-
const O = a.mergeInfo || ((P =
|
|
400
|
+
const O = a.mergeInfo || ((P = f[a.hash]) == null ? void 0 : P.mergeInfo);
|
|
401
401
|
O && Object.entries(s).forEach(([k]) => {
|
|
402
402
|
const b = c[k];
|
|
403
403
|
if (m > b) {
|
|
@@ -501,7 +501,7 @@ const le = 3e4, y = Math.random(), U = {
|
|
|
501
501
|
throw new Error(`不支持的检测类型${s}`);
|
|
502
502
|
}
|
|
503
503
|
}, Fe = {
|
|
504
|
-
command: `${
|
|
504
|
+
command: `${l.CHECK} <type>`,
|
|
505
505
|
describe: "检查git操作",
|
|
506
506
|
options: Ne(),
|
|
507
507
|
positionals: Le(),
|
|
@@ -559,20 +559,20 @@ const le = 3e4, y = Math.random(), U = {
|
|
|
559
559
|
i.error(`${t} 当前未支持处理`);
|
|
560
560
|
}
|
|
561
561
|
}, Ke = {
|
|
562
|
-
command: `${
|
|
562
|
+
command: `${l.HOOKS} <name> [args...]`,
|
|
563
563
|
describe: "git钩子回调",
|
|
564
564
|
options: De(),
|
|
565
565
|
positionals: ve(),
|
|
566
566
|
handler: J
|
|
567
567
|
}, Ye = async (e, t) => {
|
|
568
568
|
switch (e) {
|
|
569
|
-
case
|
|
569
|
+
case l.INIT:
|
|
570
570
|
return j(t);
|
|
571
|
-
case
|
|
571
|
+
case l.CLONE:
|
|
572
572
|
return V(t);
|
|
573
|
-
case
|
|
573
|
+
case l.HOOKS:
|
|
574
574
|
return J(t);
|
|
575
|
-
case
|
|
575
|
+
case l.CHECK:
|
|
576
576
|
return q(t);
|
|
577
577
|
default:
|
|
578
578
|
throw new Error(`不支持的命令 ${e}`);
|
|
@@ -592,8 +592,8 @@ const le = 3e4, y = Math.random(), U = {
|
|
|
592
592
|
export {
|
|
593
593
|
C,
|
|
594
594
|
E as G,
|
|
595
|
-
|
|
596
|
-
|
|
595
|
+
h as I,
|
|
596
|
+
l as S,
|
|
597
597
|
K as a,
|
|
598
598
|
Oe as b,
|
|
599
599
|
Ze as c,
|
package/es/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { o as i, C as l, G as t, I as d, S as c, m as C, l as p, f, h, c as u, b as k, n as I, k as E, j as b, e as H, d as g } from "./index-
|
|
3
|
-
import { a as S } from "./index-
|
|
2
|
+
import { o as i, C as l, G as t, I as d, S as c, m as C, l as p, f, h, c as u, b as k, n as I, k as E, j as b, e as H, d as g } from "./index-569e0691.js";
|
|
3
|
+
import { a as S } from "./index-d0f82826.js";
|
|
4
4
|
import "@done-coding/cli-utils";
|
|
5
5
|
import "node:fs";
|
|
6
6
|
import "node:path";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@done-coding/cli-git",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.15",
|
|
4
4
|
"description": "git跨平台操作命令行工具",
|
|
5
5
|
"private": false,
|
|
6
6
|
"module": "es/index.mjs",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
"repository": {
|
|
40
40
|
"type": "git",
|
|
41
|
-
"url": "https://
|
|
41
|
+
"url": "https://github.com/done-coding/done-coding-cli.git",
|
|
42
42
|
"directory": "packages/git"
|
|
43
43
|
},
|
|
44
44
|
"publishConfig": {
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"license": "MIT",
|
|
50
50
|
"sideEffects": false,
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@done-coding/cli-inject": "0.5.
|
|
52
|
+
"@done-coding/cli-inject": "0.5.23",
|
|
53
53
|
"@types/node": "^18.0.0",
|
|
54
54
|
"@types/yargs": "^17.0.28",
|
|
55
55
|
"typescript": "^5.8.3",
|
|
@@ -57,12 +57,12 @@
|
|
|
57
57
|
"vite-plugin-dts": "^3.6.0"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@done-coding/cli-utils": "0.8.
|
|
60
|
+
"@done-coding/cli-utils": "0.8.4",
|
|
61
61
|
"@done-coding/request-axios": "^1.2.2",
|
|
62
62
|
"axios": "^1.8.4"
|
|
63
63
|
},
|
|
64
64
|
"engines": {
|
|
65
65
|
"node": ">=18.0.0"
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "d90f437c0a716f3e62bd92a221341838710869ad"
|
|
68
68
|
}
|