mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-12-25 11:43:06 +03:00
parent
df6712cfb3
commit
dad4f54eec
6
.changes/cli-disable-version-check.md
Normal file
6
.changes/cli-disable-version-check.md
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
'tauri-cli': 'patch:bug'
|
||||
'@tauri-apps/cli': 'patch:bug'
|
||||
---
|
||||
|
||||
Removed the automatic version check of the CLI that ran after `tauri` commands which caused various issues.
|
@ -74,8 +74,6 @@ pub fn command(options: Options) -> Result<()> {
|
||||
let r = command_internal(options);
|
||||
if r.is_err() {
|
||||
kill_before_dev_process();
|
||||
#[cfg(not(debug_assertions))]
|
||||
let _ = check_for_updates();
|
||||
}
|
||||
r
|
||||
}
|
||||
@ -185,8 +183,6 @@ fn command_internal(mut options: Options) -> Result<()> {
|
||||
|
||||
let _ = ctrlc::set_handler(move || {
|
||||
kill_before_dev_process();
|
||||
#[cfg(not(debug_assertions))]
|
||||
let _ = check_for_updates();
|
||||
exit(130);
|
||||
});
|
||||
}
|
||||
@ -319,30 +315,10 @@ fn on_dev_exit(status: ExitStatus, reason: ExitReason, exit_on_panic: bool, no_w
|
||||
&& (exit_on_panic || matches!(reason, ExitReason::NormalExit)))
|
||||
{
|
||||
kill_before_dev_process();
|
||||
#[cfg(not(debug_assertions))]
|
||||
let _ = check_for_updates();
|
||||
exit(status.code().unwrap_or(0));
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(debug_assertions))]
|
||||
fn check_for_updates() -> Result<()> {
|
||||
if std::env::var_os("TAURI_SKIP_UPDATE_CHECK") != Some("true".into()) {
|
||||
let current_version = crate::info::cli_current_version()?;
|
||||
let current = semver::Version::parse(¤t_version)?;
|
||||
|
||||
let upstream_version = crate::info::cli_upstream_version()?;
|
||||
let upstream = semver::Version::parse(&upstream_version)?;
|
||||
if current < upstream {
|
||||
println!(
|
||||
"🚀 A new version of Tauri CLI is available! [{}]",
|
||||
upstream.to_string()
|
||||
);
|
||||
};
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn kill_before_dev_process() {
|
||||
if let Some(child) = BEFORE_DEV.get() {
|
||||
let child = child.lock().unwrap();
|
||||
|
Loading…
Reference in New Issue
Block a user