treehouses changelog compare <version> [version] upgrade (fixes #2164)#2169
treehouses changelog compare <version> [version] upgrade (fixes #2164)#2169
treehouses changelog compare <version> [version] upgrade (fixes #2164)#2169Conversation
rjpadilla
left a comment
There was a problem hiding this comment.
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. 😌✨ |
rjpadilla
left a comment
There was a problem hiding this comment.
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.
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.
Fixed - it now removes the duplicate CHANGELOG file.
There was a problem hiding this comment.
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:

|
|
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.
You can delete this. This belongs in the changelog.bats
There was a problem hiding this comment.
You can delete this. This belongs in the changelog.bats
I deleted the code you mentioned.
rjpadilla
left a comment
There was a problem hiding this comment.
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.