Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update chmod_x to work with non-relative paths #1470

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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