Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

Commit

Permalink
sync: remove custom "remote-cmd" option and use "rsync-path" instead
Browse files Browse the repository at this point in the history
  • Loading branch information
lekkas committed Oct 10, 2016
1 parent 6be4813 commit 76e1d23
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 9 deletions.
7 changes: 0 additions & 7 deletions lib/rsync.coffee
Expand Up @@ -31,16 +31,11 @@ buildRshOption = (options = {}) ->
description: 'port'
type: 'number'
required: true
'remote-cmd':
description: 'remote-cmd'
type: 'string'
required: false
verbose:
description: 'verbose'
type: 'boolean'

verbose = if options.verbose then '-vv ' else ''
remoteCmd = options['remote-cmd']

sshCommand = """
ssh \
Expand All @@ -52,8 +47,6 @@ buildRshOption = (options = {}) ->
-o ControlMaster=no
"""

sshCommand += " #{options.username}@#{options.host} #{remoteCmd}" if remoteCmd

return sshCommand

###*
Expand Down
2 changes: 1 addition & 1 deletion lib/sync/remote-resin-io-device.coffee
Expand Up @@ -155,7 +155,7 @@ exports.sync = (syncOptions) ->

_.assign syncOptions,
host: "ssh.#{settings.get('proxyUrl')}"
'remote-cmd': "rsync #{uuid} #{containerId}"
'rsync-path': "rsync #{uuid} #{containerId}"

command = buildRsyncCommand(syncOptions)

Expand Down
2 changes: 1 addition & 1 deletion tests/rsync.spec.coffee
Expand Up @@ -21,7 +21,7 @@ assertCommand = (command, options) ->
if options.progress
expected += ' --progress'

expected += ' --rsh=\"ssh -p 22 -o LogLevel=ERROR -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ControlMaster=no test@ssh.resindevice.io rsync 1234 4567\"'
expected += ' --rsh=\"ssh -p 22 -o LogLevel=ERROR -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ControlMaster=no\"'
expected += ' --delete'

expected += " --rsync-path=\"\\$(which rsync) 1234 4567\""
Expand Down

0 comments on commit 76e1d23

Please sign in to comment.