mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-11-28 12:27:16 +03:00
feat(bundle) add version to cargo-tauri-bundle subcommand (#31)
This commit is contained in:
parent
9559f6f999
commit
af41c71967
@ -120,20 +120,31 @@ fn run() -> crate::Result<()> {
|
||||
.value_name("FEATURES")
|
||||
.multiple(true)
|
||||
.help("Which features to build"),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("version")
|
||||
.long("version")
|
||||
.short("v")
|
||||
.help("Read the version of the CLI"),
|
||||
),
|
||||
)
|
||||
.get_matches();
|
||||
|
||||
if let Some(m) = m.subcommand_matches("tauri-bundle") {
|
||||
let output_paths = env::current_dir()
|
||||
.map_err(From::from)
|
||||
.and_then(|d| Settings::new(d, m))
|
||||
.and_then(|s| {
|
||||
r#try!(build_project_if_unbuilt(&s));
|
||||
Ok(s)
|
||||
})
|
||||
.and_then(bundle_project)?;
|
||||
bundle::print_finished(&output_paths)?;
|
||||
if m.is_present("version") {
|
||||
println!("{}", crate_version!());
|
||||
}
|
||||
else {
|
||||
let output_paths = env::current_dir()
|
||||
.map_err(From::from)
|
||||
.and_then(|d| Settings::new(d, m))
|
||||
.and_then(|s| {
|
||||
r#try!(build_project_if_unbuilt(&s));
|
||||
Ok(s)
|
||||
})
|
||||
.and_then(bundle_project)?;
|
||||
bundle::print_finished(&output_paths)?;
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user