mirror of
https://github.com/nvbn/thefuck.git
synced 2025-03-14 06:38:32 +00:00
change fixed command to use &&
rather than ;
using && so that incase the install fails the use command doesn't run and error out.
This commit is contained in:
parent
8c5386deb6
commit
865d540bfd
@ -19,8 +19,8 @@ def test_match(command):
|
||||
|
||||
|
||||
@pytest.mark.parametrize('command, new_command', [
|
||||
(Command('rvm use 2.7.2', output), 'rvm install "ruby-2.7.2"; rvm use 2.7.2'),
|
||||
(Command('rvm use 3.0.1', output), 'rvm install "ruby-3.0.1"; rvm use 3.0.1'),
|
||||
(Command('rvm use 1.6.7', output), 'rvm install "ruby-1.6.7"; rvm use 1.6.7')])
|
||||
(Command('rvm use 2.7.2', output), 'rvm install "ruby-2.7.2" && rvm use 2.7.2'),
|
||||
(Command('rvm use 3.0.1', output), 'rvm install "ruby-3.0.1" && rvm use 3.0.1'),
|
||||
(Command('rvm use 1.6.7', output), 'rvm install "ruby-1.6.7" && rvm use 1.6.7')])
|
||||
def test_get_new_command(command, new_command):
|
||||
assert get_new_command(command) == new_command
|
||||
|
@ -1,4 +1,5 @@
|
||||
from thefuck.utils import for_app
|
||||
from thefuck.shells import shell
|
||||
|
||||
|
||||
@for_app('rvm', at_least=2)
|
||||
@ -15,4 +16,4 @@ Please visit https://rvm.io/integration/gnome-terminal/ for an example."""
|
||||
|
||||
def get_new_command(command):
|
||||
args = command.script_parts
|
||||
return 'rvm install \"ruby-' + args[2] + '\"; rvm use ' + args[2]
|
||||
return shell.and_('rvm install \"ruby-{}\"'.format(args[2]), 'rvm use {}'.format(args[2]))
|
||||
|
Loading…
x
Reference in New Issue
Block a user