Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions thefuck/rules/chmod_x.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@


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):
Expand Down