-
Notifications
You must be signed in to change notification settings - Fork 20
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
treehouses changelog compare <version> [version]
upgrade (fixes #2164)
#2169
base: master
Are you sure you want to change the base?
Conversation
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.
So I don't know about you, but I kept getting Error: file does not exist!.
So I pretty much made a copy of the CHANGELOG.MD from /usr/lib/node_modules/@treehouses/cli/CHANGELOG.md
into my repo to get it running.
Moving on to the comparing:
When I run changelog compare 1.25.37 1.25.36
or vice-versa I get the output
Try 'cut --help' for more information.
ERROR: Must specify different versions for comparisons (cannot compare same version to itself)
I wouldn't know how to fix that problem...
So, my idea of fixing the comparing version issue was using a test like this (but this uses ASCII, so comparing isn't guarantee):
[[ 1.25.37 > 1.25.36 ]]
or some implemetation using the sort command:
echo -e "1.25.37\n1.25.36" | sort -V
Finally you can go with the @dogi lazy option:
dpkg --compare-versions "1.0" "lt" "1.2"
These bugs have been fixed. 😌✨ |
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.
The changelog compare still shows the changes between new version first and old version last. I don't know if the requirements are strict with only comparing old first and new last. But I'll probably leave out the changes and keep the "Did you mean..." line.
Anyways it looks a lot better than showing all the changes.
modules/changelog.sh
Outdated
if [ -d "tests" ]; then | ||
cp "/usr/lib/node_modules/@treehouses/cli/CHANGELOG.md" . | ||
else | ||
cp "/usr/lib/node_modules/@treehouses/cli/CHANGELOG.md" ../. | ||
fi |
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.
I may be mistaken but I think @dogi left checking the directory for tests/changelog.bats
Also you didn't remove the CHANGELOG file....
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.
Fixed - it now removes the duplicate CHANGELOG file.
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.
The changelog compare still shows the changes between new version first and old version last. I don't know if the requirements are strict with only comparing old first and new last. But I'll probably leave out the changes and keep the "Did you mean..." line.
Anyways it looks a lot better than showing all the changes.
Are you saying you want an error handling message when when comparing changes with the new version first and old version last?
And you're correct, the way the code is written now, the command will 'autocorrect' by displaying the changes as if the versions were switched around, then suggest the correct way to write the command:
|
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.
modules/changelog.sh
Outdated
if [ -d "tests" ]; then | ||
cp -f "/usr/lib/node_modules/@treehouses/cli/CHANGELOG.md" . 2>/dev/null || true | ||
rm -f "/usr/lib/node_modules/@treehouses/cli/CHANGELOG.md" | ||
else | ||
cp -f "/usr/lib/node_modules/@treehouses/cli/CHANGELOG.md" ../. 2>/dev/null || true | ||
rm -f "/usr/lib/node_modules/@treehouses/cli/CHANGELOG.md" | ||
fi |
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.
You can delete this. This belongs in the changelog.bats
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.
You can delete this. This belongs in the changelog.bats
I deleted the code you mentioned.
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.
My changelog is gone so I can't thoroughly test. But from the previous PR, it seems it works except for the block of code that removed my changelog. Now that you removed it, I think everything is good.
No description provided.