Skip to content

Commit c68218b

Browse files
refactor(cli): add --no-bundle flag, skip bundling on invalid formats (#8990)
* refactor(cli): add `--no-bundle` flag, skip bundling on invalid formats * enhance bundle format parsing * lint [skip ci] --------- Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
1 parent 4f78941 commit c68218b

File tree

9 files changed

+254
-196
lines changed

9 files changed

+254
-196
lines changed

.changes/cli-build-no-bundle.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'tauri-cli': 'patch:enhance'
3+
'@tauri-apps/cli': 'patch:enhance'
4+
---
5+
6+
Add `--no-bundle` flag for `tauri build` command to skip bundling. Previously `none` was used to skip bundling, it will now be treated as invalid format and a warning will be emitted instead.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'tauri-utils': 'patch:bug'
3+
---
4+
5+
Fix `BundleTarget::to_vec` returning an empty vec for `BundleTarget::All` variant.

.changes/utils-bundle-type-all.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'tauri-utils': 'patch:bug'
3+
---
4+
5+
Add `BundleType::all` method to return all possible `BundleType` variants.

core/tauri-utils/src/config.rs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,22 @@ pub enum BundleType {
121121
Updater,
122122
}
123123

124+
impl BundleType {
125+
/// All bundle types.
126+
fn all() -> &'static [Self] {
127+
&[
128+
BundleType::Deb,
129+
BundleType::Rpm,
130+
BundleType::AppImage,
131+
BundleType::Msi,
132+
BundleType::Nsis,
133+
BundleType::App,
134+
BundleType::Dmg,
135+
BundleType::Updater,
136+
]
137+
}
138+
}
139+
124140
impl Display for BundleType {
125141
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
126142
write!(
@@ -274,7 +290,7 @@ impl BundleTarget {
274290
#[allow(dead_code)]
275291
pub fn to_vec(&self) -> Vec<BundleType> {
276292
match self {
277-
Self::All => vec![],
293+
Self::All => BundleType::all().to_vec(),
278294
Self::List(list) => list.clone(),
279295
Self::One(i) => vec![i.clone()],
280296
}

examples/api/src-tauri/Cargo.lock

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)