소스 검색

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

closes #11117
Amr Bashir 10 달 전
부모
커밋
a944b9b05b

+ 7 - 0
.changes/cli-plugin-init-no-github-by-default.md

@@ -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.
+

+ 7 - 0
.changes/cli-plugin-init-no-github.md

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

+ 4 - 0
crates/tauri-cli/src/plugin/init.rs

@@ -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(

+ 4 - 0
crates/tauri-cli/src/plugin/new.rs

@@ -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,