Skip to content

Commit 51e3f41

Browse files
committed
fix exit_code
1 parent e143893 commit 51e3f41

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

linkstatus/linkstatus.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66

77
from linkstatus.parser import parse_file
88

9-
EXIT_STATUS = 0
10-
119

1210
def link_status(link):
1311
"""Check link status
@@ -46,6 +44,7 @@ def all_files(source):
4644
@click.command(help="Check Link Status")
4745
@click.argument("source", nargs=-1, type=click.Path())
4846
def main(source):
47+
exit_code = 0
4948
files = all_files(source)
5049

5150
for f in files:
@@ -68,7 +67,7 @@ def main(source):
6867
else:
6968
fg = "red"
7069
icon = "✗"
71-
EXIT_STATUS = 1
70+
exit_code = 1
7271

7372
click.echo(
7473
"{icon} L{ln} : {url}".format(
@@ -78,4 +77,4 @@ def main(source):
7877
)
7978
)
8079

81-
exit(EXIT_STATUS)
80+
exit(exit_code)

linkstatus/parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def parse_line(string):
2323
links = re.findall(REGULAR_EXP, html_format)
2424

2525
# TODO: Improve regex to remove this workaround for trailing </p> or </li>
26-
links = [l.replace("</p>", "").replace("</li>", "") for l in links]
26+
links = [l.replace("</p>", "").replace("</li>", "").replace("</a>", "") for l in links]
2727
return links
2828
else:
2929
return []

0 commit comments

Comments
 (0)