Closed LazyGeniusMan closed 2 years ago
Could also use something like "$manifest.Basename: \n$($object.version)"
for -match
regex to match manifest name and version
It's working, check this: https://github.com/LazyGeniusMan/Extras/pull/1#issuecomment-1000922879 https://github.com/LazyGeniusMan/Extras/actions/runs/1620077330/workflow
EDIT: Didn't pass negative testing, dont merge, I'll try something else https://github.com/LazyGeniusMan/Extras/runs/4631362476?check_suite_focus=true#step:3:285
Ahh, I see why it's failed, $object.version
value is old version, what's the variable for new version detected by checkver?
EDIT: looks like it's intentional, it should be failed if it's not the latest version
Alright, it's done, sorry it's a messed up commits in PR. What I did is:
$outputV
from multi line (array) into single line (string)<manifest-name>: <version>
Positive test (must passed)
Negative test (must failed), wrong version
Negative test (must failed), wrong URL
Let me know if $outputV.Count -ge 2
is still necessary
~I appreciate your effort, but I don't think removing this check entirely is a good thing. The proper way to solve the problem is to determine errors by another means (e.g. return code of a function).~
update: See comment below
Before we fix this, our maintainers can just ignore PR check fails for checkver, if we know what is going on.
but I don't think removing this check entirely is a good thing
Could you elaborate removing which check? I replaced it with another check which passed test all scenario that I can think of:
Could you elaborate removing which check? I replaced it with another check which passed test all scenario that I can think of:
- Correct URL and correct version found
- Correct URL but wrong version found (not latest version)
- Wrong URL so version not found
Sorry I was wrong. I did not think thoroughly. If Wrong URL so version not found
is the case, then package: version
should not appear at all. So there is no problem removing this part.
# If there are more than 2 lines and second line is not version, there is problem
$checkver = ((($outputV.Count -ge 2) -and ($outputV[1] -like "$($object.version)")))
Try to fix https://github.com/ScoopInstaller/Versions/pull/356 and https://github.com/ScoopInstaller/Extras/pull/7586