Skip to content

Commit

Permalink
Add macos specific upgrade instructions
Browse files Browse the repository at this point in the history
Add macos specific upgrade instructions to the update notification that
way it is easier for people to just copy and paste the commmands and run
them rather than have to go look them up on the website.

This resolves issue #156.

[changelog]
added: macos specific update instructions in update notification

<!-- ps-id: ad1bd0c9-822f-49e6-8208-ad8184b726ab -->
  • Loading branch information
drewdeponte committed Aug 29, 2023
1 parent da3ba97 commit 149fed8
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/ps/public/latest_github_release.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ pub fn newer_release_available() -> Result<Option<GitHubRelease>, NewerReleaseAv
}
}

#[cfg(not(target_os = "macos"))]
pub fn notify_of_newer_release(newer_release: Option<GitHubRelease>, color: bool) {
if let Some(latest_release) = newer_release {
utils::print_warn(
Expand All @@ -108,3 +109,23 @@ pub fn notify_of_newer_release(newer_release: Option<GitHubRelease>, color: bool
)
}
}

#[cfg(target_os = "macos")]
pub fn notify_of_newer_release(newer_release: Option<GitHubRelease>, color: bool) {
if let Some(latest_release) = newer_release {
utils::print_warn(
color,
format!(
r#"
A new release of gps is available!
{} - {}
To upgrade, run: brew update && brew upgrade git-ps-rs
"#,
latest_release.tag_name, latest_release.html_url
)
.as_str(),
)
}
}

0 comments on commit 149fed8

Please sign in to comment.