Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

target package: early exit and time comparisons #323

Closed
jasonmf opened this issue Dec 7, 2020 · 2 comments
Closed

target package: early exit and time comparisons #323

jasonmf opened this issue Dec 7, 2020 · 2 comments

Comments

@jasonmf
Copy link
Contributor

jasonmf commented Dec 7, 2020

Currently, the target package does some unnecessary filesystem inspection. It will recurse a directory or inspect a set of source files to collect the newest timestamp then compare that timestamp to a target to see if any of the source timestamps is newer than the target. The logic should be reworked to recurse/inspect, comparing against the target, and stop as soon as a newer source is found.

It would also be useful if the Dir, Glob, and Path functions supported supplying a timestamp as the target, rather than a file path. This would allow for comparison against arbitrary targets like container images using those functions. The existing three functions could then discover the target timestamp for comparison and just wrap functions that take a target timestamp.

PR inbound

@jasonmf
Copy link
Contributor Author

jasonmf commented Dec 7, 2020

Created #324

natefinch pushed a commit that referenced this issue Dec 22, 2020
* target: rework modtime comparison logic

* fix NewestModTime, add tests for NewestModTime, OldestModTime

* added tests for Dir when target is Dir

* updates per #324
@natefinch
Copy link
Member

Fixed! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants