mirror of
https://github.com/nvbn/thefuck.git
synced 2025-10-08 12:53:58 +01:00
#74 Don't fail when runned without args
This commit is contained in:
@@ -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):
|
||||||
|
Reference in New Issue
Block a user