sshkit
sshkit copied to clipboard
Mapped commands aren't re-mapped
Ran into a weird one today, I had something like:
SSHKit.config.command_map[:rake] = "/usr/local/rbenv/shims/bundle exec rake"
SSHKit.config.command_map[:ruby] = "/usr/local/rbenv/shims/ruby"
I had a problem with Rake x.x.x is already activated, bundle exec might help
so I tried mapping:
SSHKit.config.command_map[:bundle] = "/usr/local/rbenv/shims/bundle"
Then I realised it would have been nice to be able to have have mapped:
SSHKit.config.command_map[:rake] = "bundle exec rake"
and have the bundle
part of that be somehow re-expanded.
In the end I worked around by using:
SSHKit.config.command_map[:bundle] = "/usr/local/rbenv/shims/bundle"
SSHKit.config.command_map[:rake] = "/usr/local/rbenv/shims/bundle exec rake"
SSHKit.config.command_map[:ruby] = "/usr/local/rbenv/shims/ruby"
Which is still absolutely OK, but weird that I never thought of this when designing the command map.