Stop parsing language-variable cat output to make cat_dir more reliable. (#827)
* Stop parsing language-variable cat output to make cat_dir more reliable. * Add missing semicolon in readme
This commit is contained in:
committed by
Vladimir Iakovlev
parent
fe0785bc42
commit
1dfd6373ee
@@ -1,8 +1,13 @@
|
||||
import os
|
||||
|
||||
from thefuck.utils import for_app
|
||||
|
||||
|
||||
@for_app('cat')
|
||||
def match(command):
|
||||
return (
|
||||
command.script.startswith('cat') and
|
||||
command.output.startswith('cat: ') and
|
||||
command.output.rstrip().endswith(': Is a directory')
|
||||
os.path.isdir(command.script_parts[1])
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user