@kud/ai-conventional-commit-cli 0.13.1 → 0.13.2
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/dist/index.js +8 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -31,7 +31,7 @@ import crypto from "crypto";
|
|
|
31
31
|
var git = simpleGit();
|
|
32
32
|
var ensureStagedChanges = async () => {
|
|
33
33
|
const status = await git.status();
|
|
34
|
-
return status.staged.length > 0;
|
|
34
|
+
return status.staged.length > 0 || status.renamed.length > 0;
|
|
35
35
|
};
|
|
36
36
|
var getStagedDiffRaw = async () => {
|
|
37
37
|
return git.diff(["--cached", "--unified=3", "--no-color", "-M"]);
|
|
@@ -104,8 +104,12 @@ var parseDiff = async () => {
|
|
|
104
104
|
const parsed = parseDiffFromRaw(raw);
|
|
105
105
|
if (parsed.length === 0) {
|
|
106
106
|
const status = await git.status();
|
|
107
|
-
|
|
108
|
-
|
|
107
|
+
const allStaged = [
|
|
108
|
+
...status.staged.map((f) => ({ file: f, hunks: [], additions: 0, deletions: 0 })),
|
|
109
|
+
...status.renamed.map((r) => ({ file: r.to, hunks: [], additions: 0, deletions: 0 }))
|
|
110
|
+
];
|
|
111
|
+
if (allStaged.length > 0) {
|
|
112
|
+
return allStaged;
|
|
109
113
|
}
|
|
110
114
|
}
|
|
111
115
|
return parsed;
|
|
@@ -130,7 +134,7 @@ var stageFiles = async (files) => {
|
|
|
130
134
|
};
|
|
131
135
|
var getStagedFiles = async () => {
|
|
132
136
|
const status = await git.status();
|
|
133
|
-
return status.staged;
|
|
137
|
+
return [...status.staged, ...status.renamed.map((r) => r.to)];
|
|
134
138
|
};
|
|
135
139
|
|
|
136
140
|
// src/style.ts
|
package/package.json
CHANGED