Skip to content

Commit

Permalink
wmllint: Exit with non-zero status after failing to read any directories
Browse files Browse the repository at this point in the history
[ci skip]
  • Loading branch information
irydacea committed Jun 28, 2018
1 parent 3a1975a commit ed77445
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions data/tools/wmllint
Expand Up @@ -3183,8 +3183,11 @@ In your case, your system interprets your arguments as:
if not arguments:
arguments = ["."]

failed_any_dirs = False

for directory in arguments:
if not os.path.exists(directory):
failed_any_dirs = True
print("wmllint: skipping non-existent path %s" % directory)
continue
ofp = None
Expand Down Expand Up @@ -3258,6 +3261,7 @@ In your case, your system interprets your arguments as:
d.add_to_session(word.lower())
for directory in arguments:
if not os.path.exists(directory):
failed_any_dirs = True
print("wmllint: skipping non-existent path %s" % directory)
continue
ofp = None
Expand All @@ -3267,6 +3271,8 @@ In your case, your system interprets your arguments as:
spellcheck(fn, d)
except ImportError:
print("wmllint: spell check unavailable, install python-enchant to enable", file=sys.stderr)
if failed_any_dirs:
sys.exit(1)
except KeyboardInterrupt:
print("Aborted")

Expand Down

0 comments on commit ed77445

Please sign in to comment.