From 3804157f22fad90b431434ffcb9d94ebff769448 Mon Sep 17 00:00:00 2001
From: jurgenhaas <juergen@paragon-es.de>
Date: Wed, 12 Jan 2022 15:25:06 +0100
Subject: [PATCH] Allow changelog to work in a given subdirectory

---
 ahoy.changelog.yml | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/ahoy.changelog.yml b/ahoy.changelog.yml
index 481118f..05e9370 100644
--- a/ahoy.changelog.yml
+++ b/ahoy.changelog.yml
@@ -1,5 +1,9 @@
 ahoyapi: v2
 commands:
   extract:
-    cmd: git log $(git describe --tags `git rev-list --tags --max-count=1`)..HEAD --oneline | cut -d' ' -f 2-999
-    usage: Extract changelog from Git for the current project since the last release.
+    cmd: |
+      if [ "x$1" <> "x" ]; then
+        cd $1
+      fi
+      git log $(git describe --tags `git rev-list --tags --max-count=1`)..HEAD --oneline | cut -d' ' -f 2-999
+    usage: Extract changelog from Git for the current project (or the given path as 1st argument) since the last release.
-- 
GitLab