vcpkg
vcpkg copied to clipboard
[vcpkg] `vcpkg-init.cmd` returns a non-zero exit code on success
Describe the bug
The vcpkg-init.cmd
script shows usage information and returns a non-zero exit code despite successfully adding vcpkg to the shells environment.
Environment
- OS: WIndows 10 CMD
- Compiler: N/A
To Reproduce Run these commands in a Windows CMD prompt where vcpkg is already installed.
-
git clone https://github.com/azure-rtos/getting-started
-
cd getting-started\MXChip\AZ3166
-
vcpkg activate
As expected, this returns an error because vcpkg has not yet been initialized. -
%USERPROFILE%\.vcpkg\vcpkg-init.cmd
Note that usage information is displayed. -
echo %errorlevel%
Expected result: 0
Actual result: 1
Note that even though the exit code is non-zero, running vcpkg activate
now will succeed.
I can't reproduce this issue in my side, my errorlevel is 0.
Looks like this only repros if vcpkg is installed, but not already initialized. Much simpler repro steps (all in Windows CMD):
-
curl -LO https://aka.ms/vcpkg-init.cmd && .\vcpkg-init.cmd
- Close the terminal window and open a new Windows CMD window.
-
%USERPROFILE%\.vcpkg\vcpkg-init.cmd
-
echo %errorlevel%