download_strategy: add source_modified_time
This commit is contained in:
parent
fab16b83e9
commit
b24f174325
@ -26,6 +26,12 @@ class AbstractDownloadStrategy
|
|||||||
def cached_location
|
def cached_location
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# @!attribute [r]
|
||||||
|
# return most recent modified time for all files in the current working directory after stage.
|
||||||
|
def source_modified_time
|
||||||
|
Pathname.pwd.to_enum(:find).select(&:file?).map(&:mtime).max
|
||||||
|
end
|
||||||
|
|
||||||
# Remove {#cached_location} and any other files associated with the resource
|
# Remove {#cached_location} and any other files associated with the resource
|
||||||
# from the cache.
|
# from the cache.
|
||||||
def clear_cache
|
def clear_cache
|
||||||
@ -555,6 +561,10 @@ class GitDownloadStrategy < VCSDownloadStrategy
|
|||||||
cp_r File.join(cached_location, "."), Dir.pwd
|
cp_r File.join(cached_location, "."), Dir.pwd
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def source_modified_time
|
||||||
|
Time.parse Utils.popen_read("git", "--git-dir", git_dir, "show", "-s", "--format=%cD")
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def cache_tag
|
def cache_tag
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user