Skip to content

Commit b6b1c5d

Browse files
authored
Develop (#33)
* Feature/condense overview with new representation (#29) * chore: release v0.3.0 * feat: Optimized Analysis Dashboard Overview with new default matrix option * Feature/fix auto update (#32) * chore: release v0.3.0 * Feature/condense overview with new representation (#29) * chore: release v0.3.0 * feat: Optimized Analysis Dashboard Overview with new default matrix option * chore: release v0.4.0 * feat: fixed update version
1 parent 205730b commit b6b1c5d

1 file changed

Lines changed: 6 additions & 10 deletions

File tree

src/main.rs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,7 @@ use clap::Parser;
22
use syncable_cli::{
33
analyzer::{
44
self, vulnerability_checker::VulnerabilitySeverity, DetectedTechnology, TechnologyCategory, LibraryType,
5-
analyze_monorepo, analyze_monorepo_with_config, MonorepoAnalysis, ProjectCategory, ArchitecturePattern,
6-
DockerAnalysis, DockerfileInfo, ComposeFileInfo, DockerService, OrchestrationPattern,
7-
NetworkingConfig, DockerEnvironment,
8-
SecurityAnalyzer, SecurityAnalysisConfig, SecuritySeverity,
9-
DependencyAnalysis, VulnerabilitySeverity as VulnSeverity,
10-
vulnerability_checker::VulnerabilityChecker
5+
analyze_monorepo, ProjectCategory,
116
},
127
cli::{Cli, Commands, ToolsCommand, OutputFormat, SeverityThreshold, DisplayFormat},
138
config,
@@ -127,23 +122,24 @@ fn check_for_update() {
127122
}
128123
}
129124

130-
// Query crates.io with proper User-Agent header
125+
// Query GitHub releases API instead of crates.io
131126
let client = reqwest::blocking::Client::builder()
132127
.user_agent(format!("syncable-cli/{} ({})", env!("CARGO_PKG_VERSION"), env!("CARGO_PKG_REPOSITORY")))
133128
.build();
134129

135130
if let Ok(client) = client {
136131
let resp = client
137-
.get("https://crates.io/api/v1/crates/syncable-cli")
132+
.get("https://api.github.com/repos/syncable-dev/syncable-cli/releases/latest")
138133
.send()
139134
.and_then(|r| r.json::<serde_json::Value>());
140135

141136
if let Ok(json) = resp {
142-
let latest = json["crate"]["max_version"].as_str().unwrap_or("");
137+
let latest = json["tag_name"].as_str().unwrap_or("")
138+
.trim_start_matches('v'); // Remove 'v' prefix if present
143139
let current = env!("CARGO_PKG_VERSION");
144140
if latest != "" && latest != current {
145141
println!(
146-
"\x1b[33m🔔 A new version of sync-ctl is available: {latest} (current: {current})\nRun `cargo install syncable-cli --force` to update.\x1b[0m"
142+
"\x1b[33m🔔 A new version of sync-ctl is available: {latest} (current: {current})\nRun `cargo install --git https://github.com/syncable-dev/syncable-cli --tag v{latest}` to update.\x1b[0m"
147143
);
148144
}
149145
}

0 commit comments

Comments
 (0)