How to run two cake files one by one based on the first success of compiling the cake?

I want to start the source compilation of the source.cake file and then compile the Build.cake file. But I should not run Build.cake if the source.cake file has crashes. So how do you pass the compilation status of the soruce.cake to build.cake file?

Is this possible in the cake?

+4
source share
1 answer

Yes, there are several ways to do this, if you are running a Windows or Bash command prompt, you can simply use the statement &&as follows:

cake source.cake && cake build.cake

If you use PowerShell, you can do the following

cake .\source.cake;if($LASTEXITCODE -eq 0) { cake .\build.cake }

Cake Cake, source.cake build.cake, , build.cake:

//First line of build.cake
CakeExecuteScript("./source.cake");
//If above fails it'll throw an exception and stop executing build.cake
+5

Source: https://habr.com/ru/post/1659791/


All Articles