@@ -123,35 +123,33 @@ fn bundle_update(settings: &Settings, bundles: &[Bundle]) -> crate::Result<Vec<P
123123#[ cfg( target_os = "windows" ) ]
124124fn bundle_update ( settings : & Settings , bundles : & [ Bundle ] ) -> crate :: Result < Vec < PathBuf > > {
125125 // find our .msi or rebuild
126- let bundle_path = match bundles
126+ let mut bundle_paths = bundles
127127 . iter ( )
128- . filter ( |bundle| bundle. package_type == crate :: PackageType :: WindowsMsi )
129- . find_map ( |bundle| {
130- bundle
131- . bundle_paths
132- . iter ( )
133- . find ( |path| path. extension ( ) == Some ( OsStr :: new ( "msi" ) ) )
134- } ) {
135- Some ( path) => vec ! [ path. clone( ) ] ,
136- None => msi:: bundle_project ( settings) ?,
137- } ;
128+ . find ( |bundle| bundle. package_type == crate :: PackageType :: WindowsMsi )
129+ . map ( |bundle| bundle. bundle_paths . clone ( ) )
130+ . unwrap_or_default ( ) ;
138131
139- // we expect our .msi to be on bundle_path[0]
140- if bundle_path . is_empty ( ) {
141- return Err ( crate :: Error :: UnableToFindProject ) ;
132+ // we expect our .msi files to be on `bundle_paths`
133+ if bundle_paths . is_empty ( ) {
134+ bundle_paths . extend ( msi :: bundle_project ( settings ) ? ) ;
142135 }
143136
144- let source_path = & bundle_path [ 0 ] ;
137+ let mut msi_archived_paths = Vec :: new ( ) ;
145138
146- // add .tar.gz to our path
147- let msi_archived = format ! ( "{}.zip" , source_path. display( ) ) ;
148- let msi_archived_path = PathBuf :: from ( & msi_archived) ;
139+ for source_path in bundle_paths {
140+ // add .zip to our path
141+ let msi_archived = format ! ( "{}.zip" , source_path. display( ) ) ;
142+ let msi_archived_path = PathBuf :: from ( & msi_archived) ;
149143
150- // Create our gzip file
151- create_zip ( source_path, & msi_archived_path) . with_context ( || "Failed to zip update MSI" ) ?;
144+ common:: print_bundling ( format ! ( "{:?}" , & msi_archived_path) . as_str ( ) ) ?;
145+
146+ // Create our gzip file
147+ create_zip ( & source_path, & msi_archived_path) . with_context ( || "Failed to zip update MSI" ) ?;
148+
149+ msi_archived_paths. push ( msi_archived_path) ;
150+ }
152151
153- common:: print_bundling ( format ! ( "{:?}" , & msi_archived_path) . as_str ( ) ) ?;
154- Ok ( vec ! [ msi_archived_path] )
152+ Ok ( msi_archived_paths)
155153}
156154
157155#[ cfg( target_os = "windows" ) ]
0 commit comments