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:
Scott Colby
2018-07-11 14:47:06 -07:00
committed by Vladimir Iakovlev
parent fe0785bc42
commit 1dfd6373ee
3 changed files with 20 additions and 5 deletions
+7 -2
View File
@@ -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])
)