Make resin ssh work in Windows cmd.exe

Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
This commit is contained in:
Juan Cruz Viotti 2016-05-06 13:11:57 -04:00
parent 38b97baf02
commit b061644b19
2 changed files with 11 additions and 5 deletions

View File

@ -23,8 +23,8 @@ limitations under the License.
os = require('os');
if (os.platform() === 'win32') {
return {
program: 'sh',
args: ['-c', command]
program: 'cmd.exe',
args: ['/s', '/c', command]
};
} else {
return {

View File

@ -14,14 +14,20 @@ See the License for the specific language governing permissions and
limitations under the License.
###
# TODO: A function to reliably execute a command
# in all supported operating systems, including
# different Windows environments like `cmd.exe`
# and `Cygwin` should be encapsulated in a
# re-usable package.
# This is literally copy-pasted from the `resin-sync`
# module.
getSubShellCommand = (command) ->
os = require('os')
# Assume Cygwin
if os.platform() is 'win32'
return {
program: 'sh'
args: [ '-c', command ]
program: 'cmd.exe'
args: [ '/s', '/c', command ]
}
else
return {