1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// use colored::Colorize;
// use self_update::{cargo_crate_version, Status};
// use std::env;
// use tokio::task::spawn_blocking;
// pub async fn run() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
// println!("\n{} 🌱🧝\n", "Updating the seedelf-cli!".bright_white());
// println!("Current Version: {}\n", cargo_crate_version!().bright_purple());
// // Determine the target for asset selection
// let target: &str = match env::consts::OS {
// "linux" => "linux",
// "macos" => "macos",
// "windows" => "windows",
// _ => return Err(format!("Unsupported platform: {}", env::consts::OS).into()),
// };
// // Perform the update using GitHub releases in a blocking task
// let result: Status = spawn_blocking(move || {
// // UpdateBuilder::new()
// self_update::backends::github::Update::configure()
// .repo_owner("logical-mechanism")
// .repo_name("Seedelf-Wallet")
// .bin_name("seedelf-cli")
// .bin_path_in_archive("seedelf-cli")
// .target(target)
// .current_version(cargo_crate_version!())
// .show_download_progress(true)
// .show_output(true)
// .build()?
// .update()
// })
// .await??; // Await the blocking task
// if result.updated() {
// println!("{}", "\nApplication successfully updated!".bright_green());
// } else {
// println!("{}", "\n\nAlready up-to-date.".bright_yellow());
// }
// Ok(())
// }