File tree Expand file tree Collapse file tree 5 files changed +31
-6
lines changed
crates/tauri-cli/src/migrate Expand file tree Collapse file tree 5 files changed +31
-6
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " @tauri-apps/cli " : patch:bug
3
+ " tauri-cli " : patch:bug
4
+ ---
5
+
6
+ Fail with an error when trying to migrate from v2 alpha
Original file line number Diff line number Diff line change
1
+ ---
2
+ " @tauri-apps/cli " : patch:bug
3
+ " tauri-cli " : patch:bug
4
+ ---
5
+
6
+ Use v2 stable instead of v2-rc when migrating from v2-beta
Original file line number Diff line number Diff line change 3
3
// SPDX-License-Identifier: MIT
4
4
5
5
pub mod v1;
6
- pub mod v2_rc ;
6
+ pub mod v2_beta ;
Original file line number Diff line number Diff line change @@ -72,7 +72,7 @@ fn migrate_npm_dependencies(frontend_dir: &Path) -> Result<()> {
72
72
. unwrap_or_default ( )
73
73
. unwrap_or_default ( ) ;
74
74
if version. starts_with ( '1' ) {
75
- install_deps. push ( format ! ( "{pkg}@^2.0.0-rc.0 " ) ) ;
75
+ install_deps. push ( format ! ( "{pkg}@^2.0.0" ) ) ;
76
76
}
77
77
}
78
78
@@ -111,7 +111,7 @@ fn migrate_permissions(tauri_dir: &Path) -> Result<()> {
111
111
}
112
112
113
113
fn migrate_manifest ( manifest : & mut DocumentMut ) -> Result < ( ) > {
114
- let version = "2.0.0-rc.0 " ;
114
+ let version = "2.0.0" ;
115
115
116
116
let dependencies = manifest
117
117
. as_table_mut ( )
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ use crate::{
13
13
14
14
use std:: { fs:: read_to_string, str:: FromStr } ;
15
15
16
- use anyhow:: Context ;
16
+ use anyhow:: { bail , Context } ;
17
17
18
18
mod migrations;
19
19
@@ -47,9 +47,22 @@ pub fn command() -> Result<()> {
47
47
migrations:: v1:: run ( ) . context ( "failed to migrate from v1" ) ?;
48
48
} else if tauri_version. major == 2 {
49
49
if let Some ( ( pre, _number) ) = tauri_version. pre . as_str ( ) . split_once ( '.' ) {
50
- if pre == "beta" {
51
- migrations:: v2_rc:: run ( ) . context ( "failed to migrate from v2 beta to rc" ) ?;
50
+ match pre {
51
+ "beta" => {
52
+ migrations:: v2_beta:: run ( ) . context ( "failed to migrate from v2 beta" ) ?;
53
+ }
54
+ "alpha" => {
55
+ bail ! (
56
+ "Migrating from v2 alpha ({tauri_version}) to v2 stable is not supported yet, \
57
+ if your project started early, try downgrading to v1 and then try again"
58
+ )
59
+ }
60
+ _ => {
61
+ bail ! ( "Migrating from {tauri_version} to v2 stable is not supported yet" )
62
+ }
52
63
}
64
+ } else {
65
+ log:: info!( "Nothing to do, the tauri version is already at v2 stable" ) ;
53
66
}
54
67
}
55
68
You can’t perform that action at this time.
0 commit comments