mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-22 15:02:22 +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');
|
os = require('os');
|
||||||
if (os.platform() === 'win32') {
|
if (os.platform() === 'win32') {
|
||||||
return {
|
return {
|
||||||
program: 'sh',
|
program: 'cmd.exe',
|
||||||
args: ['-c', command]
|
args: ['/s', '/c', command]
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
return {
|
return {
|
||||||
|
@ -14,14 +14,20 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
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) ->
|
getSubShellCommand = (command) ->
|
||||||
os = require('os')
|
os = require('os')
|
||||||
|
|
||||||
# Assume Cygwin
|
|
||||||
if os.platform() is 'win32'
|
if os.platform() is 'win32'
|
||||||
return {
|
return {
|
||||||
program: 'sh'
|
program: 'cmd.exe'
|
||||||
args: [ '-c', command ]
|
args: [ '/s', '/c', command ]
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return {
|
return {
|
||||||
|
Loading…
Reference in New Issue
Block a user