From c7dacca4661c6ddf937c1a3dd3ace896d5baf40c Mon Sep 17 00:00:00 2001 From: Lucas Fernandes Nogueira Date: Tue, 18 Jul 2023 06:19:01 -0700 Subject: [PATCH] feat(cli): expose iOS project path and app name as env vars (#7446) --- .changes/cli-ios-metadata-env-var.md | 6 ++++++ tooling/cli/src/mobile/ios.rs | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 .changes/cli-ios-metadata-env-var.md diff --git a/.changes/cli-ios-metadata-env-var.md b/.changes/cli-ios-metadata-env-var.md new file mode 100644 index 000000000000..9399155b05f9 --- /dev/null +++ b/.changes/cli-ios-metadata-env-var.md @@ -0,0 +1,6 @@ +--- +"tauri-cli": patch:feat +"@tauri-apps/cli": patch:feat +--- + +Expose the `TAURI_IOS_PROJECT_PATH` and `TAURI_IOS_APP_NAME` environment variables when using `ios` commands. diff --git a/tooling/cli/src/mobile/ios.rs b/tooling/cli/src/mobile/ios.rs index 725c04254aff..05401a5bfda2 100644 --- a/tooling/cli/src/mobile/ios.rs +++ b/tooling/cli/src/mobile/ios.rs @@ -30,7 +30,7 @@ use super::{ }; use crate::{helpers::config::Config as TauriConfig, Result}; -use std::{process::exit, thread::sleep, time::Duration}; +use std::{env::set_var, process::exit, thread::sleep, time::Duration}; mod build; mod dev; @@ -140,6 +140,9 @@ pub fn get_config( macos: Default::default(), }; + set_var("TAURI_IOS_PROJECT_PATH", config.project_dir()); + set_var("TAURI_IOS_APP_NAME", config.app().name()); + (config, metadata) }