ScoopInstaller / Scoop

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

Exit code is 'True' even if scoop installation/uninstallation/update fails #3936

Open attilastrba opened 4 years ago

attilastrba commented 4 years ago

Scoop doesn't return correct exit codes if an installation or uninstallation fails.

PS C:\Tools\scoop\apps\scoop\current> scoop install some_program_not_in_manifest                                        Couldn't find manifest for 'some_program_not_in_manifest'.
PS C:\Tools\scoop\apps\scoop\current> $?                                                                                
True

Expected return code would be False. Same for uninstallation:

PS C:\Tools\scoop\apps\scoop\current> scoop uninstall unknown program                                                   ERROR 'unknown' isn't installed.
ERROR 'program' isn't installed.
PS C:\Tools\scoop\apps\scoop\current> $?                                                                                
True

This makes it impossible to detect errors for instance for an Ansible wrapper.

grassnick commented 3 years ago

Are you investigating this issue?

I am trying to use scoop inside a Gitlab CI and due to this issue it isnt't possible to integrate scoop into a script. If things fail, scoop has to to communicate this accordingly.

travnick commented 8 months ago

The issue is still there.

Couldn't find manifest for 'nodejs18'.

didn't abort the build, so I ended up with an invalid CI result.

Any chance of fixing this?

versat commented 2 months ago

I just stumbled about this bug while running a docker build where the powershell is set to stop on every failure. But it didn't stop when the install command did not find the manifest. I wondered why the package was not installed although everything was successful. Then I saw that scoop couldn't find the manifest (and actually it doesn't exist) but the script happily continued. This could be fatal when creating build images that then do not work correctly although the installation was reported as successfull.