blairconrad / SelfInitializingFakes

Like Fowler's self-initializing fakes.
MIT License
11 stars 3 forks source link

switch from build.ps1 to build.cmd #65

Closed adamralph closed 5 years ago

adamralph commented 5 years ago

Fixes #60

blairconrad commented 5 years ago

Thanks, @adamralph. Looks generally good, except that the how_to_build.md still says to run the ps1 file. (And I think the prereqs are a mess, but that's not your problem!)

On the other hand, I still have a deploy.ps1 for the deployment, and it'd be a shame if that was reported as successful when it weren't. Maybe we should hold off a couple of days. Appveyor changes may make this superfluous.

adamralph commented 5 years ago

We have an answer, and it seems we can fix both ps1 scripts. I'd like to find out the reason for the "swallow errors" default setting though, and investigate whether that should be changed.

thomaslevesque commented 5 years ago

I'd like to find out the reason for the "swallow errors" default setting though, and investigate whether that should be changed.

I think this is a PowerShell default setting, not related to AppVeyor

adamralph commented 5 years ago

Yep, it is indeed a PowerShell problem. It can be worked around by passing -ErrorAction Stop when executing the file. I've asked whether Appveyor will consider that, but I suspect the answer will be no, to avoid breaking projects which rely on the current behaviour. I wonder which is the lesser evil though...

adamralph commented 5 years ago

See my latest responses on the Appveyor discussion thread. I think I've come to the conclusion that build.ps1 is not a good idea and build.cmd should be used instead. PowerShell is just too broken.

blairconrad commented 5 years ago

@adamralph, thanks for continuing on. I'll worry about deploy.ps1 later, but I'm fine with a switch to build.cmd. So if you want to update the how_to_build.md, I think we can proceed with the PR.

adamralph commented 5 years ago

@blairconrad I amended the commit to fix how_to_build.md and I also noticed that the sln needed a change.

Regarding deploy.ps1, you should be OK, since you have ErrorActionPreference = "Stop" at the top.

While you could add the same line to build.ps1, it's such a trivial script that switching to build.cmd is probably better. Also, build.cmd gives a non-zero exit code when invoked from a console, and build.ps1 doesn't, even if it has ErrorActionPreference = "Stop". 🙄