bananareporter 0.4.2 → 0.4.3
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 +2 -2
- package/dist/integrations/git-cli.js +20 -4
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
@@ -103,7 +103,7 @@ $ npm install -g bananareporter
|
|
103
103
|
$ bananareporter COMMAND
|
104
104
|
running command...
|
105
105
|
$ bananareporter (--version)
|
106
|
-
bananareporter/0.4.
|
106
|
+
bananareporter/0.4.3 linux-x64 node-v18.16.0
|
107
107
|
$ bananareporter --help [COMMAND]
|
108
108
|
USAGE
|
109
109
|
$ bananareporter COMMAND
|
@@ -162,5 +162,5 @@ EXAMPLES
|
|
162
162
|
report with 138 entries saved to ./bananareporter.json
|
163
163
|
```
|
164
164
|
|
165
|
-
_See code: [dist/commands/run/index.ts](https://github.com/nya1/bananareporter/blob/v0.4.
|
165
|
+
_See code: [dist/commands/run/index.ts](https://github.com/nya1/bananareporter/blob/v0.4.3/dist/commands/run/index.ts)_
|
166
166
|
<!-- commandsstop -->
|
@@ -51,15 +51,31 @@ class GitCliIntegration extends base_1.IntegrationBase {
|
|
51
51
|
// extract project name from directory
|
52
52
|
const directory = path.basename(this.config.path);
|
53
53
|
// execute git log
|
54
|
-
const gitLogCommand = shell.exec(`git -C ${this.config.path} --no-pager log --branches="*" --author="${this.config.authorUsername
|
54
|
+
const gitLogCommand = shell.exec(`git -C ${this.config.path} --no-pager log --branches="*" --author="${this.config.authorUsername
|
55
|
+
// hash - author - date unix - commit message - branch
|
56
|
+
}" --reverse --no-merges --source --format='%H~~~~~%an~~~~~%at~~~~~%s~~~~~%S>%n%n' --after="${fromDate.toISOString()}" --before="${toDate.toISOString()}"`, {
|
55
57
|
silent: true,
|
56
58
|
});
|
57
59
|
if (gitLogCommand.code !== 0) {
|
58
60
|
throw new Error(`unable to execute git log to ${this.config.path}, output: ${gitLogCommand.stderr}`);
|
59
61
|
}
|
60
|
-
const
|
61
|
-
|
62
|
-
|
62
|
+
const gitLogJson = [];
|
63
|
+
if (gitLogCommand.stdout) {
|
64
|
+
for (const line of gitLogCommand.stdout.split('>\n\n')) {
|
65
|
+
const splitGit = line.split('~~~~~');
|
66
|
+
logger_1.logger.debug('git log', { splitGit });
|
67
|
+
if (splitGit.length !== 5) {
|
68
|
+
continue;
|
69
|
+
}
|
70
|
+
gitLogJson.push({
|
71
|
+
commit: splitGit[0].replace(/\n/g, ''),
|
72
|
+
author: splitGit[1],
|
73
|
+
dateUnix: Number(splitGit[2]),
|
74
|
+
commitMessage: splitGit[3],
|
75
|
+
branch: splitGit[4],
|
76
|
+
});
|
77
|
+
}
|
78
|
+
}
|
63
79
|
return gitLogJson.map((e, i) => {
|
64
80
|
// add project name
|
65
81
|
e.projectName = directory;
|
package/oclif.manifest.json
CHANGED