Question

I am writing a custom task for msbuild, it will connect to a Mac using SSH and run a certain command there. I need to obtain the exit status code of that command, and act based on that.

I know that in the OSX terminal I can just run echo $? to get the status code of the previous command but I'm not sure how I can use that to get a value into a variable inside of my custom build task.

Était-ce utile?

La solution

I think this will be the responsibility of the library that I use for SSH, in my case it will probably be SharpSSH, and it looks like that does have support for returning the exit code of executed command.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top