ScoopInstaller / Scoop

A command-line installer for Windows.
https://scoop.sh
Other
21.25k stars 1.41k forks source link

scoop status does not work if SCOOP_BRANCH is not set #4497

Open pratikpc opened 3 years ago

pratikpc commented 3 years ago

https://github.com/ScoopInstaller/Scoop/blob/master/libexec/scoop-status.ps1#L20

Probably due to this

scoop update is able to handle this via

https://github.com/ScoopInstaller/Scoop/blob/master/libexec/scoop-update.ps1#L47

Is this something Scoop should support?

rashil2000 commented 3 years ago

If SCOOP_BRANCH is something that is set automatically while installing Scoop itself, I don't think we should worry about handling it. (I don't remember setting it manually)

On the flip side, if a user accidentally unsets it, maybe we can show a warning that the config is unset.

pratikpc commented 3 years ago

Supporting it isn't super difficult as well. It would look like

$configBranch = get_config SCOOP_BRANCH
if (!$configBranch) {
    $configBranch = "master"
    set_config SCOOP_BRANCH $configBranch | Out-Null
}
$commits = $(git log "HEAD..origin/$configBranch" --oneline)

Another option would be to add a default value option to scoop config

Something like scoop config SCOOP_BRANCH --by-default master?