Fix operation of /dev/stdin for Windows

This commit is contained in:
Yuta Hayashibe 2022-10-10 00:27:31 +09:00
parent 0cd6425a4f
commit 9e4b88fb6a

View file

@ -47,9 +47,13 @@ def main() -> None:
if opts.tags: if opts.tags:
tags = [] tags = []
with opts.tags.open() as f: if str(opts.tags) == "/dev/stdin":
for line in f: for line in sys.stdin:
tags.append(line[:-1]) tags.append(line[:-1])
else:
with opts.tags.open() as f:
for line in f:
tags.append(line[:-1])
if stable_version not in tags: if stable_version not in tags:
sys.stderr.write(f"Tag {stable_version} not in git tags: {tags}\n") sys.stderr.write(f"Tag {stable_version} not in git tags: {tags}\n")