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

build(checkver): Fix output with '-Version' #3774

Merged
merged 3 commits into from
Jan 8, 2022

Conversation

niheaven
Copy link
Member

Before

wrong

After

right

@r15ch13
Copy link
Member

r15ch13 commented Dec 2, 2019

The same logic could be archived without the indentation by adding the check for $Version later.

Change

https://github.com/lukesampson/scoop/blob/a9fa775d59b14e7dce335313faa0eff855469764/bin/checkver.ps1#L274-L280

To

    if (!$ver) {
        next "couldn't find new version in $url"
        continue
    }

    if($Version) {
        $expected_ver = $ver
        $ver = $Version
    }

    # Skip actual only if versions are same and there is no -f
    if (($ver -eq $expected_ver) -and !$ForceUpdate -and $SkipUpdated) { continue }

@niheaven
Copy link
Member Author

niheaven commented Dec 2, 2019

@Ash258 Yes, rest is just caused by indenting

@r15ch13 The big if just skips time-consuming version finding step.

@niheaven niheaven changed the title fix(checkver): fix output with '-Version' build(checkver): Fix output with '-Version' Jan 7, 2022
@niheaven
Copy link
Member Author

niheaven commented Jan 7, 2022

Tested after resolve conflicts (merged current 'develop' branch)

Copy link
Member

@rashil2000 rashil2000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will it be possible to isolate indentation changes in a separate commit (in this PR itself)? Otherwise it's difficult to review.

@niheaven
Copy link
Member Author

niheaven commented Jan 8, 2022

Separate into two commits, Part I is just indenting, while Part II is fixed code.

@Ash258
Copy link
Contributor

Ash258 commented Jan 8, 2022

image

@niheaven
Copy link
Member Author

niheaven commented Jan 8, 2022

image

Wonderful feature that I never found in GitHub.

@rashil2000
Copy link
Member

rashil2000 commented Jan 8, 2022

image

Right, completely forgot about this 😅

But this does look a lot cleaner:

image

@niheaven niheaven merged commit 00adc0d into ScoopInstaller:develop Jan 8, 2022
@niheaven niheaven deleted the fix-checkver branch January 8, 2022 08:09
se35710 pushed a commit to se35710/scoop that referenced this pull request Mar 8, 2022
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

Successfully merging this pull request may close these issues.

4 participants