feat(cli): add `--github-workflows` (#11118)

closes #11117
This commit is contained in:
Amr Bashir 2024-09-25 03:11:38 +03:00 committed by GitHub
parent 06718b4569
commit a944b9b05b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 22 additions and 0 deletions

View File

@ -0,0 +1,7 @@
---
"tauri-cli": "patch:breaking"
"@tauri-apps/cli": "patch:breaking"
---
`tauri plugin init/new` will no longer generate a `.github` directory with workflows by default, instead use the new `--github-workflows` flag.

View File

@ -0,0 +1,7 @@
---
"tauri-cli": "patch:feat"
"@tauri-apps/cli": "patch:feat"
---
Add `--github-workflows` flag for `tauri plugin new/init`.

View File

@ -56,6 +56,9 @@ pub struct Options {
#[clap(long)]
#[clap(default_value_t = PluginIosFramework::default())]
pub(crate) ios_framework: PluginIosFramework,
/// Generate github workflows
#[clap(long)]
pub(crate) github_workflows: bool,
/// Initializes a Tauri core plugin (internal usage)
#[clap(long, hide(true))]
@ -193,6 +196,7 @@ pub fn command(mut options: Options) -> Result<()> {
return Ok(None);
}
}
".github" if !options.github_workflows => return Ok(None),
"android" => {
if options.android || options.mobile {
return generate_android_out_file(

View File

@ -37,6 +37,9 @@ pub struct Options {
#[clap(long)]
#[clap(default_value_t = PluginIosFramework::default())]
pub(crate) ios_framework: PluginIosFramework,
/// Generate github workflows
#[clap(long)]
github_workflows: bool,
/// Initializes a Tauri core plugin (internal usage)
#[clap(long, hide(true))]
@ -58,6 +61,7 @@ impl From<Options> for super::init::Options {
ios: o.ios,
mobile: o.mobile,
ios_framework: o.ios_framework,
github_workflows: o.github_workflows,
tauri: o.tauri,
tauri_path: o.tauri_path,