mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-22 06:57:48 +00:00
Make resin ssh work in Windows cmd.exe
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
This commit is contained in:
parent
38b97baf02
commit
b061644b19
@ -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 {
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user