-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[Bug] Different output for scoop config last_update
depending on shell
#5229
Comments
Sorry it's PowerShell's display rule, and is not scoop's scope. Just read config file directly should help. |
I initially thought that too, but when I do PS > $value = [System.DateTime]::Now
PS > $value
Friday, 28 October 2022 16:28:56
PS > $value.ToString("o")
2022-10-28T16:28:56.9216980+01:00 It seems like the fix would be for |
In fact that value is internal used, and not advised to set or get by users... Why not read the file? |
I can do, but I wouldn't be surprised if I'm the only one who's been relying on this for scripting reasons and figured it might be useful for others if this was fixed (plus it's easier to just read the output of the command directly), so thought I'd raise it. Not a big deal though. |
Looks like |
This is on purpose, because the raw output gives users freedom to deal with it however they want. If you'd like it to output consistently you can specify an output format. |
Can you give me an example of this? I've tried using Edit: I found I can do |
As I said, |
That's fine, I already have a workaround for my original usage, so I'm happy. I just thought it was worth bringing up and explaining my rationale for why I think it's worth fixing. If we disagree on whether it is worth fixing then fair enough, I won't invest any time creating a PR to fix it. |
I still wonder why you need that value... Is there some special usage that we haven't found? Or is there some existed feature that could fit it but is hard to find? |
As I mentioned in the original post, I'm using the value as part of my dotfiles management to sync config across multiple machines. I use chezmoi and I'm using the output of
My current workaround is to change the template to use |
Gotta, may fix in next release. |
That'd be great, no worries if not though. I think the logic in the config script should be simple enough to fix, but I was unsure how to write a test to cover the change as the existing tests check the format and pass, even when I run them locally in Powershell 7. |
|
Thanks, I can do |
Bug Report
Current Behavior
When I run
scoop config last_update
in Powershell 7 (pwsh
) or the Command Prompt (cmd
), I get a formatted date, e.g:When I run the same command in Windows Powershell (v5,
powershell
), I get the same format as inconfig.json
:Expected Behavior
Regardless of the shell, I would expect the date to be the same format as in
config.json
.Additional context/output
The value in
config.json
is maintaining the same format inconfig.json
when scoop is run in Powershell 7, it only appears to bescoop config last_update
that is impacted. I've been using the output to avoid triggering changes in my dotfiles, but since the format is different to the file content it sees a difference in the file.System details
Windows version: 11 2H22
OS architecture: 64bit
PowerShell version: 7.2.7
Windows Powershell version: 5.1.22621.608
Scoop Configuration
The text was updated successfully, but these errors were encountered: