-
Notifications
You must be signed in to change notification settings - Fork 90
Closed
Description
Describe the bug
Even if LibMan CLI operation has finished with errors, exit code of the process is 0. This is a little inconvenient for build scripts or Dockerfiles when you don't know that some libraries haven't been restored, for example, because of library CDN provider's temporary unavailability or bugs. The only workaround is to check stderr and fail when there is any output, but it seems that returning non-zero exit code would be a more clear indication that something went wrong.
To Reproduce
Steps to reproduce the behavior:
- Create temporary Docker container with .NET 5.0 SDK and attach to its terminal:
sudo docker run --rm -it mcr.microsoft.com/dotnet/sdk:5.0
- Install LibMan CLI tool
export PATH="$PATH:/root/.dotnet/tools"
dotnet tool install -g Microsoft.Web.LibraryManager.Cli
- Perform any illegal operation. For example, try to restore libraries in the directory without
libman.json
file.
root@0f7d49cfdfcc:/# libman restore
libman.json was not found:/libman.json
- Check exit code of libman:
root@0f7d49cfdfcc:/# echo $?
0
- Exit code is zero despite libman command failure
Expected behavior
Exit code of libman is non-zero
Additional context
LibMan CLI version: 2.1.161+abc97ecc7d.RR
klotztech and tommy4421
Metadata
Metadata
Assignees
Labels
No labels