Skip to content
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

Add update notification functionality #14

Closed
11 tasks
TalAter opened this issue Feb 3, 2018 · 5 comments
Closed
11 tasks

Add update notification functionality #14

TalAter opened this issue Feb 3, 2018 · 5 comments

Comments

@TalAter
Copy link
Member

TalAter commented Feb 3, 2018

Thank you for your help ❤️

What is this project?

DAV (Decentralized Autonomous Vehicles) is a new non-profit foundation working to build an open-source infrastructure for autonomous vehicles (cars, drones, trucks, robots, and all the service providers around them) to communicate and transact with each other over blockchain.

DAV CLI

The DAV CLI (command-line interface) tool makes developing applications and solutions that interact with DAV a much more pleasant experience. It allows developers to run fully functioning blockchains on their computer with one command, generate secure keys, and more.

How you can help

The Issue

The DAV CLI is usually installed globally on the user's machine. Since there is no good way for users to know when a new version is released, we would like to show them a message when they are using an old version of the CLI.

Luckily, there is a tool that enables this very easily 🎉 update-notifier.

Add the simple integration with update-notifier to the CLI's index.js file.

Contributing to DAV CLI

  • Make sure this issue is labeled up-for-grabs and not labeled claimed, to verify no one else is working on it.
  • Comment in this issue that you would like to do it.
  • Open the DAV CLI GitHub page and click the ★ Star and then ⑂ Fork buttons.
  • Clone a copy to your local machine with $ git clone git@github.com:YOUR-GITHUB-USER-NAME/dav-cli.git
  • Run npm install to install all dependencies.
  • Run dav-cli by calling ./bin/dav-cli.js. You can also pass arguments to it (e.g., ./bin/dav-cli.js -s -p 1234).
  • Now, code, code, code.
  • Once you've made sure all your changes work correctly and committed all your changes, push your local changes back to github with $ git push -u origin master
  • Visit your fork on GitHub.com (https://github.com/YOUR-USER-NAME/dav-cli) and create a pull request for your changes.
  • Make sure your pull request describes exactly what you changed and references this issue (include the issue number in the title like this: #5)
  • Please do not fix more than one issue at a time. Your pull request should only fix what is described in this issue.

Asking for help

We appreciate your effort in taking the time to work on this issue and help out the open source community and the foundation.
If you need any help, feel free to ask below or in our gitter channel. We are always happy to help 😄

@koutron
Copy link
Contributor

koutron commented Feb 4, 2018

would love to tackle this

@TalAter
Copy link
Member Author

TalAter commented Feb 4, 2018

Go for it!

@koutron
Copy link
Contributor

koutron commented Feb 6, 2018

Got it working - Right now the updateNotifier function is sitting after all the require statements in the global scope of index.js. Is that appropriate? Should I create a program method for the notification? Here is the snippet below:

const updateNotifier = require('update-notifier');
const pkg = require('../package.json');

updateNotifier({ pkg }).notify();

program.on('--help', () => {

@TalAter
Copy link
Member Author

TalAter commented Feb 6, 2018

I think placing it in an external file as you suggest might be more elegant.

@koutron koutron mentioned this issue Feb 17, 2018
8 tasks
@koutron
Copy link
Contributor

koutron commented Feb 17, 2018

Pull request added at #18

@koutron koutron mentioned this issue Feb 17, 2018
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants