mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-01-31 00:35:19 +01:00
Less statics fixup (#14833)
* fix(tauri-cli): be more conservative to preserve behavior (#14804) * refactor(tauri-cli): move app path initialization into commands
This commit is contained in:
@@ -104,7 +104,6 @@ enum Commands {
|
||||
}
|
||||
|
||||
pub fn command(cli: Cli, verbosity: u8) -> Result<()> {
|
||||
let dirs = crate::helpers::app_paths::resolve_dirs();
|
||||
let noise_level = NoiseLevel::from_occurrences(verbosity as u64);
|
||||
match cli.command {
|
||||
Commands::Init(options) => init_command(
|
||||
@@ -113,7 +112,6 @@ pub fn command(cli: Cli, verbosity: u8) -> Result<()> {
|
||||
false,
|
||||
options.skip_targets_install,
|
||||
options.config,
|
||||
&dirs,
|
||||
)?,
|
||||
Commands::Dev(options) => dev::command(options, noise_level)?,
|
||||
Commands::Build(options) => build::command(options, noise_level).map(|_| ())?,
|
||||
|
||||
@@ -29,8 +29,8 @@ pub fn command(
|
||||
reinstall_deps: bool,
|
||||
skip_targets_install: bool,
|
||||
config: Vec<ConfigValue>,
|
||||
dirs: &Dirs,
|
||||
) -> Result<()> {
|
||||
let dirs = crate::helpers::app_paths::resolve_dirs();
|
||||
let wrapper = TextWrapper::default();
|
||||
|
||||
exec(
|
||||
@@ -45,14 +45,14 @@ pub fn command(
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn exec(
|
||||
fn exec(
|
||||
target: Target,
|
||||
wrapper: &TextWrapper,
|
||||
#[allow(unused_variables)] non_interactive: bool,
|
||||
#[allow(unused_variables)] reinstall_deps: bool,
|
||||
skip_targets_install: bool,
|
||||
config: Vec<ConfigValue>,
|
||||
dirs: &Dirs,
|
||||
dirs: Dirs,
|
||||
) -> Result<App> {
|
||||
let tauri_config = get_tauri_config(
|
||||
target.platform_target(),
|
||||
|
||||
@@ -167,7 +167,12 @@ pub struct BuiltApplication {
|
||||
options_handle: OptionsHandle,
|
||||
}
|
||||
|
||||
pub fn command(options: Options, noise_level: NoiseLevel, dirs: &Dirs) -> Result<BuiltApplication> {
|
||||
pub fn command(options: Options, noise_level: NoiseLevel) -> Result<BuiltApplication> {
|
||||
let dirs = crate::helpers::app_paths::resolve_dirs();
|
||||
run(options, noise_level, &dirs)
|
||||
}
|
||||
|
||||
pub fn run(options: Options, noise_level: NoiseLevel, dirs: &Dirs) -> Result<BuiltApplication> {
|
||||
let mut build_options: BuildOptions = options.clone().into();
|
||||
build_options.target = Some(
|
||||
Target::all()
|
||||
|
||||
@@ -102,7 +102,6 @@ enum Commands {
|
||||
|
||||
pub fn command(cli: Cli, verbosity: u8) -> Result<()> {
|
||||
let noise_level = NoiseLevel::from_occurrences(verbosity as u64);
|
||||
let dirs = crate::helpers::app_paths::resolve_dirs();
|
||||
match cli.command {
|
||||
Commands::Init(options) => init_command(
|
||||
MobileTarget::Ios,
|
||||
@@ -110,10 +109,9 @@ pub fn command(cli: Cli, verbosity: u8) -> Result<()> {
|
||||
options.reinstall_deps,
|
||||
options.skip_targets_install,
|
||||
options.config,
|
||||
&dirs,
|
||||
)?,
|
||||
Commands::Dev(options) => dev::command(options, noise_level)?,
|
||||
Commands::Build(options) => build::command(options, noise_level, &dirs).map(|_| ())?,
|
||||
Commands::Build(options) => build::command(options, noise_level).map(|_| ())?,
|
||||
Commands::Run(options) => run::command(options, noise_level)?,
|
||||
Commands::XcodeScript(options) => xcode_script::command(options)?,
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ pub fn command(options: Options, noise_level: NoiseLevel) -> Result<()> {
|
||||
|
||||
let dirs = crate::helpers::app_paths::resolve_dirs();
|
||||
|
||||
let mut built_application = super::build::command(
|
||||
let mut built_application = super::build::run(
|
||||
super::build::Options {
|
||||
debug: !options.release,
|
||||
targets: Some(vec![]), /* skips IPA build since there's no target */
|
||||
|
||||
Reference in New Issue
Block a user