Skip to content
Merged
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
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions psst-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
use git_version::git_version;

pub const GIT_VERSION: &str = git_version!();
pub const BUILD_VERSION: &str = match option_env!("RELEASE_VERSION") {
Some(version) => version,
None => env!("CARGO_PKG_VERSION"),
};
pub const BUILD_TIME: &str = include!(concat!(env!("OUT_DIR"), "/build-time.txt"));
pub const REMOTE_URL: &str = include!(concat!(env!("OUT_DIR"), "/remote-url.txt"));

Expand Down
1 change: 1 addition & 0 deletions psst-gui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ ureq = { version = "3.0.11", features = ["json", "socks-proxy"] }
url = { version = "2.5.4" }
infer = "0.19.0"
base64 = "0.22.1"
semver = "1.0.26"

# GUI
druid = { git = "https://github.com/jpochyla/druid", branch = "psst", features = [
Expand Down
17 changes: 14 additions & 3 deletions psst-gui/src/data/update_checker.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use druid::{Data, Lens};
use semver::Version;
use serde::{Deserialize, Serialize};
use std::{
env,
Expand All @@ -13,7 +14,7 @@ use std::process::Command;
use url::Url;

const GITHUB_API_URL: &str = "https://api.github.com/repos/isaaclins/psst/releases/latest";
const CURRENT_VERSION: &str = env!("CARGO_PKG_VERSION");
const CURRENT_VERSION: &str = psst_core::BUILD_VERSION;
const UPDATE_CHECK_INTERVAL: Duration = Duration::from_secs(24 * 60 * 60); // 24 hours

#[derive(Clone, Debug, Data, Serialize, Deserialize, PartialEq)]
Expand Down Expand Up @@ -115,8 +116,18 @@ impl UpdateInfo {
let remote = remote.trim_start_matches('v');
let current = current.trim_start_matches('v');

// For date-based versions like "2025.11.15-abc1234"
// Just do a string comparison since they're chronologically ordered
if remote == current {
return false;
}

if let (Ok(remote_semver), Ok(current_semver)) =
(Version::parse(remote), Version::parse(current))
{
return remote_semver > current_semver;
}

// For date-based versions like "2025.11.15-abc1234" just fall back to a string comparison;
// the lexical order preserves chronology when using ISO-style dates.
remote > current
}

Expand Down
2 changes: 1 addition & 1 deletion psst-gui/src/ui/preferences.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1498,7 +1498,7 @@ fn updates_tab_widget() -> impl Widget<AppState> {
.with_spacer(theme::grid(2.0))
.with_child(Label::new(format!(
"Current Version: {}",
env!("CARGO_PKG_VERSION")
psst_core::BUILD_VERSION
)))
.with_spacer(theme::grid(1.0))
.with_child(
Expand Down
Loading