-
Notifications
You must be signed in to change notification settings - Fork 1
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
Fix, simplify, and improve certain aspects of the project. #24
base: master
Are you sure you want to change the base?
Conversation
print current tag to stderr. Tell expected tag format. Early GITHUB_TOKEN check.
8e1ba1d
to
04f4bf6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR and sorry about the slow reply time.
I think this is a good change overall, catching problems earlier is good and I'm all for switching to f-strings.
I only really have one comment on the code, as you can see. But Codady has plenty, that should be solved.
I also think the new exit codes should be described in the README, under usage.
current_name = self.repo.git.describe(all=True) | ||
print(f"Current name: {current_name}", file=sys.stderr) | ||
current_tag = self.repo.rev_parse(current_name) | ||
print(f"Current tag id: {current_tag}", file=sys.stderr) | ||
try: | ||
return str(tag.tag) | ||
except AttributeError: | ||
return str(tag) | ||
self.current_tag = current_tag.tag | ||
print(f"Current tag: {self.current_tag}", file=sys.stderr) | ||
except (AttributeError, BadName, GitCommandError): | ||
print("Not an annotated tag!", file=sys.stderr) | ||
exit(4) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since GitCommandError is caught here, I think you might've meant to include the git calls inside the try block.
Glad to hear it! I'll try to fix all these things soon :) |
Recently, I began to use Publish for myself, as it sort of matches my workflow. While trying it out, I encountered several errors and edge cases, which I have now fixed. Here is an abridged listing of my changes: