Update informer for CLI applications written in Rust 🦀

Overview

Update-informer

CI

Update informer for CLI applications written in Rust 🦀

Usage

Add to Cargo.toml:

[dependencies]
update-notifier = "0.1.0"

To check the version on crates.io:

{ println!("New version is available: {}", version); } None => { println!("No new version"); } }">
use update_informer::registry::Crates;

match update_informer::check_version(Crates, env!("CARGO_PKG_NAME"), env!("CARGO_PKG_VERSION"))? {
    Some(version) => {
        println!("New version is available: {}", version);
    }
    None => {
        println!("No new version");
    }
}

To check the version on GitHub:

{ println!("New version is available: {}", version); } None => { println!("No new version"); } };">
use update_informer::registry::GitHub;

// Format: {owner}/{repo}
let pkg_name = format!("{}/{}", env!("CARGO_PKG_NAME"), env!("CARGO_PKG_NAME"));

match update_informer::check_version(GitHub, &pkg_name, env!("CARGO_PKG_VERSION"))? {
    Some(version) => {
        println!("New version is available: {}", version);
    }
    None => {
        println!("No new version");
    }
};

Sponsors

Sponsored by Evrone

License

MIT

Comments
  • A better cache directory naming scheme

    A better cache directory naming scheme

    Fixes #18

    ✔ Checklist:

    • [x] Commit messages have been written in Conventional Commits format;
    • [x] This PR has been added to CHANGELOG.md (at the top of the list);
    • [x] Tests for the changes have been added (for bug fixes / features). To the extent possible, anyway, see below.
    opened by itamarst 9
  • Less fakes in testing strategy

    Less fakes in testing strategy

    I'm working on branch for #18, all unit tests pass... but running the example CLI to get a PyPI package is not working. So I would suggest less #[cfg(test)] code variants and more just running with the real code paths.

    stale 
    opened by itamarst 5
  • More standardized location for

    More standardized location for "last-checked" file

    On the assumption that pip has done the relevant research correctly:

    1. For Unix-y systems, use "$XDG_CACHE_HOME/app-name" or fallback to "~/.cache/app-name". (https://github.com/pypa/pip/blob/dec279ecdf8fd2b0f984dd213198635fdbe320c7/src/pip/_vendor/platformdirs/unix.py#L86)
    2. For Windows, CSIDL_LOCAL_APPDATA (https://github.com/pypa/pip/blob/dec279ecdf8fd2b0f984dd213198635fdbe320c7/src/pip/_vendor/platformdirs/windows.py#L62)
    3. For macOS, "~/Library/Caches/app-name" (https://github.com/pypa/pip/blob/dec279ecdf8fd2b0f984dd213198635fdbe320c7/src/pip/_vendor/platformdirs/macos.py#L37).
    opened by itamarst 5
  • Timeouts for ureq usage

    Timeouts for ureq usage

    • Given networks can have issues, there should probably be some sort of timeouts set on the ureq HTTP client.
    • The timeouts should be fairly short, since the version check is not the user's goal, it's a nice-to-have.
    opened by itamarst 5
  • feat(get_latest_version): support current version

    feat(get_latest_version): support current version

    Hello! Thanks for the awesome library. We're planning to use this with https://github.com/vercel/turbo, but we have an additional requirement that I'm hoping we can include here.

    We implemented a custom registry (ultimately it goes NPM, but with an intermediate edge function for performance reasons), and we want to be able to make a different API request depending on the users distribution. For example, if a user is on a canary (example version may be: 1.7.0-canary.0) we would want to alert them about new canary versions. However, if a user is on the latest distribution (1.6.3), we would only want to check for new versions under the latest tag.

    This PR extends the get_latest_version API to add a second parameter, current_version: &Version. This allows the user to inspect the current version (via something like current_version.get().pre) to determine what API request to make.

    Happy to write more tests or docs if you think this is worthwhile, thank you!

    ✔ Checklist:

    • [X] Commit messages have been written in Conventional Commits format;
    • [X] Tests for the changes have been added (for bug fixes / features).
    opened by tknickman 4
  • chore: bump wagoid/commitlint-github-action from 4.1.11 to 4.1.12

    chore: bump wagoid/commitlint-github-action from 4.1.11 to 4.1.12

    Bumps wagoid/commitlint-github-action from 4.1.11 to 4.1.12.

    Changelog

    Sourced from wagoid/commitlint-github-action's changelog.

    4.1.12 (2022-05-07)

    Bug Fixes

    Commits
    • d608cb1 chore(release): publish 4.1.12 [skip-ci]
    • 0f5f7da Merge pull request #411 from wagoid/ci/fix-unsafe-repository-issue
    • ce9a8cb fix: set workspace directory as safe in the entrypoint
    • 534ab20 Merge pull request #383 from Fdawgs/chore/husky
    • ce2ed3e chore(.husky): add husky source [skip-ci]
    • f464c30 chore(.husky): remove unnecessary .gitignore [skip-ci]
    • ba2f2b5 Merge pull request #375 from wagoid/dependabot/npm_and_yarn/commitlint/cli-16...
    • cf75e07 Merge pull request #320 from wagoid/dependabot/npm_and_yarn/conventional-chan...
    • bbf526c chore(deps-dev): bump @​commitlint/cli from 13.2.1 to 16.2.3
    • 3043808 chore(deps-dev): bump conventional-changelog-cli from 2.1.1 to 2.2.2
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies github_actions stale 
    opened by dependabot[bot] 4
  • PyPI support

    PyPI support

    ✔ Checklist:

    • [x] Commit messages have been written in Conventional Commits format;
    • [x] This PR has been added to CHANGELOG.md (at the top of the list);
    • [x] Tests for the changes have been added (for bug fixes / features).
    opened by itamarst 4
  • chore: bump Swatinem/rust-cache from 2.0.1 to 2.0.2

    chore: bump Swatinem/rust-cache from 2.0.1 to 2.0.2

    Bumps Swatinem/rust-cache from 2.0.1 to 2.0.2.

    Release notes

    Sourced from Swatinem/rust-cache's releases.

    v2.0.2

    • Avoid calling cargo metadata on pre-cleanup.
    Changelog

    Sourced from Swatinem/rust-cache's changelog.

    2.0.2

    • Avoid calling cargo metadata on pre-cleanup.
    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies github_actions 
    opened by dependabot[bot] 2
  • chore: bump wagoid/commitlint-github-action from 4.1.11 to 5.0.0

    chore: bump wagoid/commitlint-github-action from 4.1.11 to 5.0.0

    Bumps wagoid/commitlint-github-action from 4.1.11 to 5.0.0.

    Changelog

    Sourced from wagoid/commitlint-github-action's changelog.

    5.0.0 (2022-06-16)

    ⚠ BREAKING CHANGES

    • chore: rename circleci windows job
    • requires lerna v5

    Features

    4.1.15 (2022-06-16)

    4.1.14 (2022-06-16)

    4.1.13 (2022-06-16)

    4.1.12 (2022-05-07)

    Bug Fixes

    Commits
    • fd24864 chore(release): publish 5.0.0 [skip-ci]
    • d345d2f Merge pull request #453 from wagoid/feat/upgrade-commitlint-packages
    • 91c000c feat: upgrade @​commitlint packages
    • 4160451 chore(release): publish 4.1.15 [skip-ci]
    • 978af54 Merge pull request #451 from wagoid/build/add-docker-to-dependabot
    • 8ccdafb chore: use caret in required node version
    • fa61bca build: add docker to dependabot
    • 707eac1 chore(release): publish 4.1.14 [skip-ci]
    • 7445d4e Merge pull request #410 from diogokiss/security-vuln-docker-image
    • e8277e2 Merge pull request #429 from wagoid/dependabot/npm_and_yarn/actions/github-5.0.3
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies github_actions 
    opened by dependabot[bot] 2
  • chore: bump lycheeverse/lychee-action from 1.4.1 to 1.5.0

    chore: bump lycheeverse/lychee-action from 1.4.1 to 1.5.0

    Bumps lycheeverse/lychee-action from 1.4.1 to 1.5.0.

    Release notes

    Sourced from lycheeverse/lychee-action's releases.

    Version 1.5.0

    Major Changes

    • Run action without Docker for a ~40% performance improvement (#121) @​mre
    • Bump lychee to v0.10.0 (#130) @​mre
    • Add support for Github Job Summaries (#127) @​mre
    • Only append markdown if format isn't JSON (#101) @​flcdrg
    • Fix condition in README (#102) @​mbg
    • Bump peter-evans/create-issue-from-file from 3 to 4 (#98)
    • Update link to dependabot config @​mre
    • Update links.yml @​mre
    • Deep link to lychee commandline parameters @​mre

    Full Changelog: https://github.com/lycheeverse/lychee-action/compare/v1.4.1...v1.5.0

    Thanks to all the testers, contributors, and maintainers for improving lychee-action! ❤️

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies github_actions stale 
    opened by dependabot[bot] 2
  • chore: bump wagoid/commitlint-github-action from 2 to 4.1.9

    chore: bump wagoid/commitlint-github-action from 2 to 4.1.9

    Bumps wagoid/commitlint-github-action from 2 to 4.1.9.

    Release notes

    Sourced from wagoid/commitlint-github-action's releases.

    v2.0.3

    Features

    • use config-conventional as default config

    v2.0.2

    Updated action to be published on CI

    v2.0.1

    Bug Fixes

    • action shows error ouput when not all commits have warnings (0911cae), closes #43
    Changelog

    Sourced from wagoid/commitlint-github-action's changelog.

    Commits
    • 296247d chore(release): publish 4.1.9 [skip-ci]
    • 40f4505 Merge pull request #259 from wagoid/fix/help-url-ignored
    • 6f0b49b fix: use helpUrl from config when present
    • 06415eb chore(release): publish 4.1.8 [skip-ci]
    • a5ab401 Merge pull request #258 from wagoid/chore/upgrade-commitlint-dev-deps
    • c13f233 chore(deps): upgrade commitlint-plugin-function-rules
    • 4a39fcf chore(release): publish 4.1.7 [skip-ci]
    • f1eac79 chore(deps-dev): upgrade @commitlint/* dev deps
    • a509674 Merge pull request #256 from wagoid/chore/upgrade-commitlint-packages
    • 18c274c chore(deps): upgrade @commitlint/* packages
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies github_actions 
    opened by dependabot[bot] 2
  • chore: bump orhun/git-cliff-action from 1 to 2

    chore: bump orhun/git-cliff-action from 1 to 2

    Bumps orhun/git-cliff-action from 1 to 2.

    Release notes

    Sourced from orhun/git-cliff-action's releases.

    Release v2.0.0

    Changelog

    [2.0.0] - 2022-12-25

    Chore

    docker

    • Update git-cliff to 1.0.0

    Release v1.2.2

    Changelog

    [1.2.2] - 2022-12-21

    Fix

    action

    • Revert working directory permissions after generating changelog

    Release v1.2.1

    Changelog

    [1.2.1] - 2022-12-19

    Refactor

    action

    • Simplify git safe directory workaround

    Release v1.2.0

    Changelog

    [1.2.0] - 2022-12-01

    Chore

    docker

    • Update git-cliff to 0.10.0

    Docs

    readme

    • Update advanced example about set-output usage

    Feat

    action

    • Add an output for the changelog content (#4)

    Fix

    action

    • Use the correct working directory (#5)

    ... (truncated)

    Commits
    • aca5ee3 docs(readme): recommend the use of v2 instead of v1
    • 506cfd7 chore(docker): update git-cliff to 1.0.0
    • See full diff in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies github_actions 
    opened by dependabot[bot] 1
Releases(v0.6.0)
Owner
Grachev Mikhail
🚀 Senior Software Engineer 🐳 DevOps Engineer 😍 Open Source Activist & Contributor 🎤 Speaker 🤩 Core-contributor: @dotenv-linter, @reviewdog, @goreleaser 🔥
Grachev Mikhail
Plex webhook service to automatically update your Anilist watching list.

anifunnel Plex webhook service to automatically update your Anilist watching list. Description anifunnel is a web server that will consume incoming Pl

Hamuko 3 Dec 12, 2022
Update Twitter profile with a meter showing how close you are to code burnout.

WakaTime Code Burnout Meter in Twitter Profile Inspired by trash's Twitter profile, this repo adds a burnout meter to your Twitter profile. It uses Wa

Travis A. Wagner 6 Jan 12, 2023
Terminal plotting library for using in Rust CLI applications

textplots Terminal plotting library for using in Rust CLI applications. Should work well in any unicode terminal with monospaced font. It is inspired

Alexey Suslov 163 Dec 30, 2022
CarLI is a framework for creating single-command and multi-command CLI applications in Rust

CarLI is a framework for creating single-command and multi-command CLI applications in Rust. The framework provides error and IO types better suited for the command line environment, especially in cases where unit testing is needed.

Kevin Herrera 3 Jan 21, 2022
An extensible plotting library for CLI applications.

termplot An extensible plotting library for CLI applications. Quick Start Documentation Examples Plotting a function Historigram Composing multiple pl

Xavier Hamel 3 Jan 1, 2023
CLI for self-bootstrapped Python applications

PyApp PyApp is a CLI wrapper for Python applications that bootstrap themselves at runtime. Each application is configured with environment variables a

Ofek Lev 6 May 10, 2023
A CLI tool to get help with CLI tools 🐙

A CLI tool to get help with CLI tools ?? halp aims to help find the correct arguments for command-line tools by checking the predefined list of common

Orhun Parmaksız 566 Apr 16, 2023
General Rust Actix Applications and AWS Programming Utilities

RUST Actix-Web Microservice Our Rust Beginners Kit for Application Development A collection of sample code using the actix rust framework to A) Develo

IntelliConnect Technologies 58 Nov 21, 2022
argmax is a library that allows Rust applications to avoid Argument list too long errors (E2BIG) by providing a std::process::Command wrapper with a

argmax argmax is a library that allows Rust applications to avoid Argument list too long errors (E2BIG) by providing a std::process::Command wrapper w

David Peter 22 Nov 20, 2022
A strong, compile-time enforced authorization framework for rust applications.

DACquiri A compile-time enforced authorization framework for Rust applications. Authorization In typical applications, authorization checks are perfor

resync 247 Dec 20, 2022
Menu Utilities for Desktop Applications in Rust.

muda Menu Utilities for Desktop Applications. Example Create the root menu and add submenus and men items. let mut menu = Menu::new(); let file_menu

Amr Bashir 28 Dec 16, 2022
Sets of libraries and tools to write applications and libraries mixing OCaml and Rust

Sets of libraries and tools to write applications and libraries mixing OCaml and Rust. These libraries will help keeping your types and data structures synchronized, and enable seamless exchange between OCaml and Rust

Meta 36 Jan 28, 2023
Background task processing for Rust applications with Tokio, Diesel, and PostgreSQL.

Async persistent background task processing for Rust applications with Tokio. Queue asynchronous tasks to be processed by workers. It's designed to be

Rafael Carício 22 Mar 27, 2023
Rust in Anger: high-performance web applications

Rust in Anger: Book demo This is the code repository that accompanies the Rust in Anger blog post. The following folders each come with their own buil

EqualTo 26 Apr 9, 2023
Rustato: A powerful, thread-safe global state management library for Rust applications, offering type-safe, reactive state handling with an easy-to-use macro-based API.

Rustato State Manager A generical thread-safe global state manager for Rust Introduction • Features • Installation • Usage • Advanced Usage • Api Refe

BiteCraft 8 Sep 16, 2024
create and test the style and formatting of text in your terminal applications

description: create and test the style and formatting of text in your terminal applications docs: https://docs.rs/termstyle termstyle is a library tha

Rett Berg 18 Jul 3, 2021
Pixel-perfect integer scaling for windowed applications

integer-fullscreen Pixel-perfect integer scaling for windowed applications. Usage Run the program. Move your cursor to a window you would like to get

Cecile Tonglet 6 May 23, 2021
A tool for automating terminal applications in Unix.

expectrl A tool for automating terminal applications in Unix. Using the library you can: Spawn process Control process Expect/Verify responces It was

Maxim Zhiburt 132 Dec 14, 2022
A dead simple functional testing tool for command line applications

Pharaoh : build that test pyramid! What it is Pharaoh is a dead simple, no permission needed, functional test runner for command line applications, wr

Kevin Sztern 17 Dec 13, 2021