Skip to content

Commit

Permalink
feat(cli): add --github-workflows (#11118)
Browse files Browse the repository at this point in the history
closes #11117
  • Loading branch information
amrbashir authored Sep 25, 2024
1 parent 06718b4 commit a944b9b
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .changes/cli-plugin-init-no-github-by-default.md
Original file line number Diff line number Diff line change
@@ -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 changes: 7 additions & 0 deletions .changes/cli-plugin-init-no-github.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"tauri-cli": "patch:feat"
"@tauri-apps/cli": "patch:feat"
---

Add `--github-workflows` flag for `tauri plugin new/init`.

4 changes: 4 additions & 0 deletions crates/tauri-cli/src/plugin/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))]
Expand Down Expand Up @@ -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(
Expand Down
4 changes: 4 additions & 0 deletions crates/tauri-cli/src/plugin/new.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))]
Expand All @@ -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,
Expand Down

0 comments on commit a944b9b

Please sign in to comment.