Closed ivan-iljin closed 3 years ago
Eh, turns out at the start of the script i had
set ERRORLEVEL=0
And in this case cmd
doesn't allow sub-processes to override that error level.
I've removed that line and now the return code 1
comes fine.
PS: I decided to look more into my code after i saw how die
is defined here:
https://github.com/nvie/gitflow/blob/15aab26490facf285acef56cb5d61025eacb3a69/gitflow-common
Even better, to reset old ERRORLEVEL, i'll use
set ERRORLEVEL=
This removes the value and allows sub-processes to set a new one.
Say i have some unstaged changes, and i run
git flow release...
On windows, here is my .bat script:The condition works fine for other programs, the program stops on errors, and outputs the warning but not in case of
git flow release ...
Actual: On fatal error "Working tree contains unstaged changes", git flow returns 0 from the process. Making it hard to catch errors in case of scripting the flow.
Expected: A fatal error like this should always return a non-zero code from the process.