Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ on:
pull_request:
branches: [main]

permissions:
contents: read

concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true

env:
CARGO_TERM_COLOR: always

Expand All @@ -16,6 +23,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@1.91
with:
components: rustfmt
Expand All @@ -27,6 +36,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@1.91
with:
components: clippy
Expand All @@ -43,6 +54,8 @@ jobs:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@1.91
- uses: Swatinem/rust-cache@v2
- run: cargo test --workspace --all-targets --all-features
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ push = false
publish = false
tag-name = "v{{version}}"
pre-release-commit-message = "release: v{{version}}"
pre-release-hook = ["git", "cliff", "-o", "CHANGELOG.md", "--latest"]
pre-release-hook = ["git", "cliff", "-o", "CHANGELOG.md", "--tag", "v{{version}}"]
2 changes: 1 addition & 1 deletion src/banner.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use color_print::{cprintln, cstr};
use color_print::cprintln;

use crate::Config;

Expand Down
2 changes: 1 addition & 1 deletion src/cmds/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ fn text_output(
println!("You have {} update/s to install 📦", updates.len());
} else {
for update in updates {
print_update(&update, &manifest)?;
print_update(update, manifest)?;
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(dead_code)]
use std::path::PathBuf;

use anyhow::{Context, Result};
Expand Down Expand Up @@ -175,7 +176,7 @@ async fn main() -> anyhow::Result<()> {
github_token: cli.github_token,
};

let skip_banner = cli.command.as_ref().map_or(false, |c| c.skip_banner());
let skip_banner = cli.command.as_ref().is_some_and(|c| c.skip_banner());

if !skip_banner {
banner::print_banner(&config);
Expand Down
9 changes: 2 additions & 7 deletions src/manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,13 @@ pub fn build_octocrab(config: &Config) -> anyhow::Result<Octocrab> {
builder.build().context("building octocrab client")
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub enum Installer {
#[default]
GithubRelease,
Instructions,
}

impl Default for Installer {
fn default() -> Self {
Self::GithubRelease
}
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Tool {
pub name: String,
Expand Down
8 changes: 4 additions & 4 deletions src/updates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ async fn evaluate_update(tool: &Tool, config: &Config) -> anyhow::Result<Option<
let current = find_installed_version(tool, config).await?;
let requested = VersionReq::parse(&tool.version)?;

if let Some(current) = &current {
if requested.matches(&current) {
return Ok(None);
}
if let Some(current) = &current
&& requested.matches(current)
{
return Ok(None);
}

Ok(Some(Update {
Expand Down
Loading