Skip to content

Commit

Permalink
feat(cli): add migrate command (#7008)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasfernog committed May 20, 2023
1 parent d1304ff commit b0f9477
Show file tree
Hide file tree
Showing 8 changed files with 678 additions and 4 deletions.
6 changes: 6 additions & 0 deletions .changes/migrate-cmd.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"cli.rs": patch
"cli.js": patch
---

Added `migrate` command.
53 changes: 50 additions & 3 deletions tooling/cli/Cargo.lock

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

1 change: 1 addition & 0 deletions tooling/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ duct = "0.13"
toml_edit = "0.14"
json-patch = "0.2"
tauri-utils = { version = "2.0.0-alpha.5", path = "../../core/tauri-utils", features = [ "isolation", "schema", "config-json5", "config-toml" ] }
tauri-utils-v1 = { version = "1", package = "tauri-utils", features = [ "isolation", "schema", "config-json5", "config-toml" ] }
toml = "0.5"
jsonschema = "0.16"
handlebars = "4.3"
Expand Down
2 changes: 1 addition & 1 deletion tooling/cli/src/interface/rust/manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ pub fn read_manifest(manifest_path: &Path) -> crate::Result<Document> {
Ok(manifest)
}

fn toml_array(features: &HashSet<String>) -> Array {
pub fn toml_array(features: &HashSet<String>) -> Array {
let mut f = Array::default();
let mut features: Vec<String> = features.iter().map(|f| f.to_string()).collect();
features.sort();
Expand Down
4 changes: 4 additions & 0 deletions tooling/cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ mod icon;
mod info;
mod init;
mod interface;
mod migrate;
mod mobile;
mod plugin;
mod signer;
Expand Down Expand Up @@ -96,6 +97,8 @@ enum Commands {
Android(mobile::android::Cli),
#[cfg(target_os = "macos")]
Ios(mobile::ios::Cli),
/// Migrate from v1 to v2
Migrate,
}

fn format_error<I: CommandFactory>(err: clap::Error) -> clap::Error {
Expand Down Expand Up @@ -198,6 +201,7 @@ where
Commands::Android(c) => mobile::android::command(c, cli.verbose)?,
#[cfg(target_os = "macos")]
Commands::Ios(c) => mobile::ios::command(c, cli.verbose)?,
Commands::Migrate => migrate::command()?,
}

Ok(())
Expand Down
Loading

0 comments on commit b0f9477

Please sign in to comment.