Skip to content

Bug: CommandMap prefix ignores override #299

Closed
@sbonami

Description

@sbonami

When defining a command_map override, output matches intended functionality:

SSHKit.config.command_map[:rake] = 'pitch_fork'
SSHKit.config.command_map[:rake] => 'pitch_fork'

However, when a prefix for the command exists, the original command is served with the prefix rather than the override:

SSHKit.config.command_map[:rake] = 'pitch_fork'
SSHKit.config.command_map[:rake].push("bundle exec")
SSHKit.config.command_map[:rake] => 'bundle exec rake'

I would figure we'd get this:

SSHKit.config.command_map[:rake] = 'pitch_fork'
SSHKit.config.command_map[:rake].push("bundle exec")
SSHKit.config.command_map[:rake] => `bundle exec pitch_fork`

Should L45 be something like this?:

"#{prefixes} #{@map[command] || command}"

Related source: https://github.com/capistrano/sshkit/blob/master/lib/sshkit/command_map.rb#L42-L45

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions