Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Commit 7088667

Browse files
authored
Merge pull request #3852 from magento/ds_fix-last-modified-at-plugin
Make last-modified-at plugin to work correct in subrepos
2 parents c397f2a + 319bb0f commit 7088667

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

_plugins/last-modified-at.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,11 @@
1818

1919
real_filepath = File.realpath page.path
2020

21+
dir = File.dirname real_filepath
22+
filename = File.basename real_filepath
23+
2124
# Read date of the last committ and assign it to last_modified_at parameter
2225
# of the page.
2326
page.data['last_modified_at'] =
24-
`git log -1 --format=%cd --date=iso -- #{real_filepath}`.strip
27+
`cd #{dir} && git log -1 --format=%cd --date=iso -- #{filename}`.strip
2528
end

0 commit comments

Comments
 (0)