Skip to content

Commit d089d38

Browse files
committed
refactor(changelog_cli): use --path option to limit the commits to the provided directory
1 parent df67fe6 commit d089d38

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

changelog_cli/lib/src/commands/generate_command.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ class GenerateCommand extends Command<int> {
4242
argParser.addOption(
4343
'path',
4444
abbr: 'p',
45-
help: 'Path to the package',
45+
help: 'Path to the git repository or folder in that repository. '
46+
'Providing a subdirectory will limit the changelog to '
47+
'that subdirectory.',
4648
defaultsTo: '.',
4749
);
4850
argParser.addOption(
@@ -178,7 +180,7 @@ class GenerateCommand extends Command<int> {
178180
if (start?.isNotEmpty == true) {
179181
final endRef = end?.isNotEmpty == true ? end! : 'HEAD';
180182
final commitsRaw = await gitDir.runCommand(
181-
['rev-list', '--format=raw', endRef, '^$start'],
183+
['rev-list', '--format=raw', endRef, '^$start', path],
182184
);
183185
final commits = Commit.parseRawRevList(commitsRaw.stdout as String);
184186
return commits;

0 commit comments

Comments
 (0)