From f1d01dd16c6ec051471f7f4f635ca2ff8dd3c8ca Mon Sep 17 00:00:00 2001 From: xzvf Date: Sun, 15 Dec 2019 21:55:01 +0100 Subject: [PATCH] Bump to 3.30 --- setup.py | 2 +- thefuck/rules/chmod_x.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 7beb16f7..07a5aade 100755 --- a/setup.py +++ b/setup.py @@ -31,7 +31,7 @@ elif (3, 0) < version < (3, 4): ' ({}.{} detected).'.format(*version)) sys.exit(-1) -VERSION = '3.29' +VERSION = '3.30' install_requires = ['psutil', 'colorama', 'six', 'decorator', 'pyte'] extras_require = {':python_version<"3.4"': ['pathlib2'], diff --git a/thefuck/rules/chmod_x.py b/thefuck/rules/chmod_x.py index 09e685ee..27945c95 100644 --- a/thefuck/rules/chmod_x.py +++ b/thefuck/rules/chmod_x.py @@ -3,10 +3,11 @@ from thefuck.shells import shell def match(command): + file_to_run = os.path.expanduser(command.script_parts[0]) return (command.script.startswith('./') and 'permission denied' in command.output.lower() - and os.path.exists(command.script_parts[0]) - and not os.access(command.script_parts[0], os.X_OK)) + and os.path.exists(file_to_run) + and not os.access(file_to_run, os.X_OK)) def get_new_command(command):