From a3e1cb67181fd966051f8607bda66a8f0f2ff473 Mon Sep 17 00:00:00 2001 From: mcarton Date: Tue, 29 Dec 2015 18:38:58 +0100 Subject: [PATCH] Fix `thefuck unzip`, fix #416 --- thefuck/rules/dirty_unzip.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/thefuck/rules/dirty_unzip.py b/thefuck/rules/dirty_unzip.py index 3e45ea37..b13d3f1f 100644 --- a/thefuck/rules/dirty_unzip.py +++ b/thefuck/rules/dirty_unzip.py @@ -24,8 +24,14 @@ def _zip_file(command): @for_app('unzip') def match(command): - return ('-d' not in command.script - and _is_bad_zip(_zip_file(command))) + if '-d' in command.script: + return False + + zip_file = _zip_file(command) + if zip_file: + return _is_bad_zip(zip_file) + else: + return False def get_new_command(command):