@@ -76,7 +76,7 @@ function _find_app_bundle(package)
7676            if  os .isfile (info_plist ) and  os .isdir (macos_dir ) then 
7777                return  abs_location , appbundle_name 
7878            else 
79-                 print ( "        Invalid .app structure"  )
79+                 raise ( " Invalid .app structure"  )
8080            end 
8181        end 
8282    end 
@@ -135,7 +135,7 @@ function _create_staging_dir(package, app_source, appbundle_name, bg_image)
135135        local  bg_dest  =  path .join (staging_dir , path .filename (bg_image ))
136136        os .vcp (bg_image , bg_dest )
137137        if  not  os .isfile (bg_dest ) then 
138-             print (" Warning: Failed to copy background image"  )
138+             wprint (" Warning: Failed to copy background image"  )
139139        end 
140140    end 
141141    return  staging_dir 
@@ -192,15 +192,7 @@ function _create_dmg_with_create_dmg(create_dmg, package, staging_dir, dmg_file,
192192    os .vrunv (" mkdir"  , {" -p"  , path .directory (dmg_file )})
193193    os .vrunv (" rm"  , {" -f"  , dmg_file })
194194    --  run create-dmg
195-     local  ok , errors  =  os .iorunv (create_dmg .program , args )
196-     if  ok  then 
197-         return  true 
198-     else 
199-         if  errors  then 
200-             print (" Error output:"  , errors )
201-         end 
202-         return  false 
203-     end 
195+     os .iorunv (create_dmg .program , args )
204196end 
205197--  verify dmg file
206198function  _verify_dmg (dmg_file )
@@ -215,9 +207,11 @@ function _pack_dmg(package)
215207    local  create_dmg  =  _get_create_dmg ()
216208    --  find existing .app bundle
217209    local  app_source , appbundle_name  =  _find_app_bundle (package )
210+     
218211    if  not  app_source  then 
219212        return  false 
220213    end 
214+ 
221215    --  find background image (optional)
222216    local  bg_image  =  _find_background_image (package )
223217    --  get output dmg path
0 commit comments