Description:
Question:
How could I make a batch file for Windows (10) in order to execute the grails command over and over again until its result is successful
>>> I tried with this: How to run command until it succeeds?, but I had not luck with it. It executes the command the first time only and then stops even when there were some errors resolving the dependencies as shown in the image below.
Some help would be really appreciated.
Found a workaround:
Logic:
Code:
@echo off
:loop
echo Executing command...
call grails war
if exist "<full_path_to_war_file>" (
echo Success!
) else (
echo Failed!
echo Retrying!
goto loop
)
echo Done!
Important: This variant uses the functionality of grails for creating a war. Grails, before creating the war, tries to resolve those pending dependencies, so if this fails, the war is never made, and this way, the failure of the dependencies resolution can be detected.
I'd like to say I've never had done a .bat before until now (so, this might be improved a lot), and thanks a lot to those who posted here.