diff --git a/thefuck/rules/chmod_x.py b/thefuck/rules/chmod_x.py index 09e685ee..794d7b76 100644 --- a/thefuck/rules/chmod_x.py +++ b/thefuck/rules/chmod_x.py @@ -3,10 +3,9 @@ from thefuck.shells import shell def match(command): - 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)) + return ('permission denied' in command.output.lower() + and os.path.exists(os.path.expanduser(command.script_parts[0])) + and not os.access(os.path.expanduser(command.script_parts[0]), os.X_OK)) def get_new_command(command):