-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
Add clock
cli flag
#9138
Add clock
cli flag
#9138
Conversation
This is a feature that would make my life a lot easier. What are the chances of getting this reviewed and rebased any time soon? |
Thumbs up and useful contributions tend to do that ;) The "build time" moniker is slightly misleading but I like the concept. If it has enough testing to make sure it works as expected and when the "conflicts that must be resolved" are resolved (probably just a fetch of the current HEAD and re-check) our little conversation here will put it in the TODO pile again and someone who knows Golang will surely have a look. |
@satotake Are you still interested in this issue/PR? If not, I'd be happy to take it over and do a rebase in a new PR. |
92f2a2e
to
dc25c77
Compare
Honestly, this PR has been a dim memory for me but rebasing and resolving were not so tough. If you do not mind, could you review this PR or have any idea, @bep? |
* Fix `resource.IsFuture` and `resource.IsExpired` args * Move `TestBuildTimeFlag` in `commands/list_test.go` to `hugo_sites_build_test.go` * Isolate `TestShouldBuildWithNowOverride` in `hugolib/page_test.go`
Due to capturing stdout for list command test
OK, I have thought some more about this, and I think we need to do an adjustment. The thing is, when we're changing the build time, I also suspect people would also expect the clock to change in other situations, e.g.:
Should always print true. With that in mind, I think we need a ... clock. What I suggest is that we
Thoughts? |
Looks good. I thought just
I have presumed fixed time for this. yes but it is ok to make it running. I will check it your package.
Not sure but I suspect that they are not all but most. For example, values for logging and so on? Anyway, I will check it, too. |
Thanks, I have rebased this into a new PR and will finish this in #9864 |
ok I replaced time.Now with htime.Now as much as possible (including logging) for now. except for
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
issue #8787
If I understand @regisphilibert 's comment properly, with the flag, users want to check
now
in templatehugo list
outputIf so, we can implement this flag by just replacing a few of
time.Now()
without changing internal time of go.This PRs add
buildTime
flag in order to fake hugo's build datetime like soClose #8787