-
Notifications
You must be signed in to change notification settings - Fork 348
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
feature request: telling user when new version is available #35
Changes from all commits
5449d5c
b3509e3
8f0a322
0f33b74
0092e92
83c77eb
5b4c0a8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { getOpenCommitLatestVersion } from '../api'; | ||
import currentPackage from '../../package.json' assert { type: 'json' }; | ||
import chalk from 'chalk'; | ||
export const checkIsLatestVersion = async () => { | ||
const latestVersion = await getOpenCommitLatestVersion(); | ||
|
||
if (latestVersion) { | ||
const currentVersion = currentPackage.version; | ||
|
||
if (currentVersion !== latestVersion) { | ||
console.warn( | ||
chalk.yellow( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @nader-zouaoui What do you think about already suggesting the command to perform the update? ex:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Makes sense, will do it |
||
` | ||
You are not using the latest stable version of OpenCommit! | ||
Consider updating to the latest version to get the latest features and bug fixes. | ||
Current version: ${currentVersion} | ||
Latest version: ${latestVersion} | ||
🎉 To update to the latest version, run: npm update opencommit | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
` | ||
) | ||
); | ||
} | ||
} | ||
}; |
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.
@nader-zouaoui the current version is already 1.1.16. Is your branch up to date?
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.
These are the computed changes after the merge, so yeah it will be up-to-date after this
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.
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 understood!
Per the Contribution Guidelines the pull request must be opened to the master branch. That's why I got confused.
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 think Contribution Guidelines should be updated, and the default should be the
dev
branch.