Skip to content

Commit 4019d9a

Browse files
Feature/add automatic cli update (#22)
* Feature/update dependabot (#11) * chore: release v0.1.4 * Feature/dependabot (#3) * chore: release v0.1.4 * Create dependabot.yml * feat: depndabot branch strategy * chore(deps): bump dirs from 5.0.1 to 6.0.0 Bumps [dirs](https://github.com/soc/dirs-rs) from 5.0.1 to 6.0.0. - [Commits](https://github.com/soc/dirs-rs/commits) --- updated-dependencies: - dependency-name: dirs dependency-version: 6.0.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * chore(deps): bump reqwest from 0.11.27 to 0.12.19 Bumps [reqwest](https://github.com/seanmonstar/reqwest) from 0.11.27 to 0.12.19. - [Release notes](https://github.com/seanmonstar/reqwest/releases) - [Changelog](https://github.com/seanmonstar/reqwest/blob/master/CHANGELOG.md) - [Commits](seanmonstar/reqwest@v0.11.27...v0.12.19) --- updated-dependencies: - dependency-name: reqwest dependency-version: 0.12.19 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Update README.md * Update README.md --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore: release v0.1.5 * Develop (#15) * Feature/update dependabot (#11) * chore: release v0.1.4 * Feature/dependabot (#3) * chore: release v0.1.4 * Create dependabot.yml * feat: depndabot branch strategy * chore(deps): bump dirs from 5.0.1 to 6.0.0 Bumps [dirs](https://github.com/soc/dirs-rs) from 5.0.1 to 6.0.0. - [Commits](https://github.com/soc/dirs-rs/commits) --- updated-dependencies: - dependency-name: dirs dependency-version: 6.0.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * chore(deps): bump reqwest from 0.11.27 to 0.12.19 Bumps [reqwest](https://github.com/seanmonstar/reqwest) from 0.11.27 to 0.12.19. - [Release notes](https://github.com/seanmonstar/reqwest/releases) - [Changelog](https://github.com/seanmonstar/reqwest/blob/master/CHANGELOG.md) - [Commits](seanmonstar/reqwest@v0.11.27...v0.12.19) --- updated-dependencies: - dependency-name: reqwest dependency-version: 0.12.19 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Update README.md * Update README.md --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Update dependabot.yml * feat: Added tool install verifier with cli calls (#14) Before we didn't check if users where missing tools with a expressive incormation enought, this update will highlight the missing tools users needs to security validate for instance python, go and java applications. --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Revert "Develop (#15)" This reverts commit 8ac0cfe. * feat: Added tool install verifier with cli calls (#14) Before we didn't check if users where missing tools with a expressive incormation enought, this update will highlight the missing tools users needs to security validate for instance python, go and java applications. * chore: release v0.2.0 * feat: Implemented automatic update information --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent 37d1dde commit 4019d9a

4 files changed

Lines changed: 42 additions & 13 deletions

File tree

CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,27 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66

77
## [Unreleased]
88

9+
## [0.2.0](https://github.com/syncable-dev/syncable-cli/compare/v0.1.5...v0.2.0) - 2025-06-06
10+
11+
### Added
12+
13+
- Added tool install verifier with cli calls ([#14](https://github.com/syncable-dev/syncable-cli/pull/14))
14+
15+
## [0.1.5](https://github.com/syncable-dev/syncable-cli/compare/v0.1.4...v0.1.5) - 2025-06-06
16+
17+
### Added
18+
19+
- cargo lock update
20+
21+
### Other
22+
23+
- Feature/update dependabot ([#11](https://github.com/syncable-dev/syncable-cli/pull/11))
24+
- Update README.md
25+
- Update README.md
26+
- *(deps)* bump reqwest from 0.11.27 to 0.12.19
27+
- *(deps)* bump dirs from 5.0.1 to 6.0.0
28+
- Feature/dependabot ([#3](https://github.com/syncable-dev/syncable-cli/pull/3))
29+
930
## [0.1.4](https://github.com/syncable-dev/syncable-cli/compare/v0.1.3...v0.1.4) - 2025-06-05
1031

1132
### Added

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "syncable-cli"
3-
version = "0.1.4"
3+
version = "0.2.0"
44
edition = "2024"
55
authors = ["Syncable Team"]
66
description = "A Rust-based CLI that analyzes code repositories and generates Infrastructure as Code configurations"

src/main.rs

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ use std::fs;
1111
use std::path::PathBuf;
1212
use std::time::{SystemTime, Duration};
1313
use dirs::cache_dir;
14-
use reqwest::blocking::get;
1514

1615
#[tokio::main]
1716
async fn main() {
@@ -119,16 +118,25 @@ fn check_for_update() {
119118
}
120119
}
121120

122-
// Query crates.io
123-
let resp = get("https://crates.io/api/v1/crates/syncable-cli")
124-
.and_then(|r| r.json::<serde_json::Value>());
125-
if let Ok(json) = resp {
126-
let latest = json["crate"]["max_version"].as_str().unwrap_or("");
127-
let current = env!("CARGO_PKG_VERSION");
128-
if latest != "" && latest != current {
129-
println!(
130-
"\x1b[33m🔔 A new version of sync-ctl is available: {latest} (current: {current})\nRun `cargo install syncable-cli --force` to update.\x1b[0m"
131-
);
121+
// Query crates.io with proper User-Agent header
122+
let client = reqwest::blocking::Client::builder()
123+
.user_agent(format!("syncable-cli/{} ({})", env!("CARGO_PKG_VERSION"), env!("CARGO_PKG_REPOSITORY")))
124+
.build();
125+
126+
if let Ok(client) = client {
127+
let resp = client
128+
.get("https://crates.io/api/v1/crates/syncable-cli")
129+
.send()
130+
.and_then(|r| r.json::<serde_json::Value>());
131+
132+
if let Ok(json) = resp {
133+
let latest = json["crate"]["max_version"].as_str().unwrap_or("");
134+
let current = env!("CARGO_PKG_VERSION");
135+
if latest != "" && latest != current {
136+
println!(
137+
"\x1b[33m🔔 A new version of sync-ctl is available: {latest} (current: {current})\nRun `cargo install syncable-cli --force` to update.\x1b[0m"
138+
);
139+
}
132140
}
133141
}
134142

0 commit comments

Comments
 (0)