mirror of
https://github.com/nvbn/thefuck.git
synced 2025-04-19 01:00:42 +01:00
#74 Don't fail when runned without args
This commit is contained in:
parent
d09238a6e8
commit
d5b4bddc4c
@ -61,6 +61,7 @@ def test_get_command():
|
|||||||
stdout=PIPE,
|
stdout=PIPE,
|
||||||
stderr=PIPE,
|
stderr=PIPE,
|
||||||
env={'LANG': 'C'})
|
env={'LANG': 'C'})
|
||||||
|
assert main.get_command(Mock(), ['']) is None
|
||||||
|
|
||||||
|
|
||||||
def test_get_matched_rule():
|
def test_get_matched_rule():
|
||||||
|
@ -80,6 +80,10 @@ def get_command(settings, args):
|
|||||||
script = ' '.join(arg.decode('utf-8') for arg in args[1:])
|
script = ' '.join(arg.decode('utf-8') for arg in args[1:])
|
||||||
else:
|
else:
|
||||||
script = ' '.join(args[1:])
|
script = ' '.join(args[1:])
|
||||||
|
|
||||||
|
if not script:
|
||||||
|
return
|
||||||
|
|
||||||
result = Popen(script, shell=True, stdout=PIPE, stderr=PIPE,
|
result = Popen(script, shell=True, stdout=PIPE, stderr=PIPE,
|
||||||
env=dict(os.environ, LANG='C'))
|
env=dict(os.environ, LANG='C'))
|
||||||
if wait_output(settings, result):
|
if wait_output(settings, result):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user