mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-01-14 13:00:10 -06:00
Handle case when executable is not executable
- Changed error message if executable is not executable Closes:[1159](https://github.com/pre-commit/pre-commit/issues/1159)
This commit is contained in:
@@ -51,10 +51,12 @@ def normexe(orig):
|
||||
if exe is None:
|
||||
_error('not found')
|
||||
return exe
|
||||
elif not os.access(orig, os.X_OK):
|
||||
_error('not found')
|
||||
elif os.path.isdir(orig):
|
||||
_error('is a directory')
|
||||
elif not os.path.isfile(orig):
|
||||
_error('not found')
|
||||
elif not os.access(orig, os.X_OK): # pragma: windows no cover
|
||||
_error('is not executable')
|
||||
else:
|
||||
return orig
|
||||
|
||||
|
||||
Reference in New Issue
Block a user