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.

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top