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

[Bug] scoop commands does not return errort code on Git bash #6228

Open
xudyang1 opened this issue Nov 11, 2024 · 1 comment
Open

[Bug] scoop commands does not return errort code on Git bash #6228

xudyang1 opened this issue Nov 11, 2024 · 1 comment
Labels

Comments

@xudyang1
Copy link

xudyang1 commented Nov 11, 2024

Bug Report

Current Behavior

  1. open git bash
  2. run scoop prefix unknown_package
  3. outputs read message Could not find app path for 'unknown_package'.
  4. check exit code echo $? is 0. That means the above red message is written to stdout instead of stderr.

Expected Behavior

The exit code should be 1 (as in pwsh, $LASTEXITCODE is 1)

Additional context/output

Scoop scripts uses abort "msg..." to write error output, but when I test it with a local .ps1 script, it reports

The term 'abort' is not recognized as a name of a cmdlet,
 function, script file, or executable program. Check the
 spelling of the name, or if a path was included, verify
 that the path is correct and try again.

Possible Solution

use throw or Write-Error "msg..." with exit 1, or keep using abort "msg..." and then add exit 1 after it?

System details

Windows version: [e.g. 7, 8, 10, 11]
10

OS architecture: [e.g. 32bit, 64bit, arm64]
64bit

PowerShell version: [output of "$($PSVersionTable.PSVersion)"]
7.4.6

Additional software: [(optional) e.g. ConEmu, Git]
Git bash: downloaded by scoop install git, version git version 2.45.2.windows.1

Scoop Configuration

{
  "last_update": "2024-11-11T00:10:49.2099138-05:00",
  "scoop_repo": "https://github.com/ScoopInstaller/Scoop",
  "scoop_branch": "master"
}
@xudyang1 xudyang1 added the bug label Nov 11, 2024
@xudyang1
Copy link
Author

Related #2032

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant