lib/csd/application/minisip/component/gnome.rb in csd-0.3.0 vs lib/csd/application/minisip/component/gnome.rb in csd-0.3.1

- old
+ new

@@ -37,10 +37,13 @@ def create_desktop_entry # In fact, we would like to update the desktop entry it each time the AI (re-)compiles minisip # So we do not return here now # return if Path.minisip_gnome_pixmap.file? and Path.minisip_desktop_entry.file? UI.info "Installing Gnome menu item".green.bold - Cmd.run("sudo cp #{Path.minisip_gnome_png} #{Path.minisip_gnome_pixmap}", :announce_pwd => false) + # It might be that the requested branch does not have the new gnome_icon.png in minisip/share + # That's why we have to use the default logo as a fallback solution + Path.usable_gnome_png = Path.minisip_gnome_png.file? ? Path.minisip_gnome_png : Path.minisip_gnome_png_fallback + Cmd.run "sudo cp #{Path.usable_gnome_png} #{Path.minisip_gnome_pixmap}", :announce_pwd => false Path.new_desktop_entry = Pathname.new File.join(Path.work, 'minisip.desktop') Cmd.touch_and_replace_content Path.new_desktop_entry, DESKTOP_ENTRY, :internal => true Cmd.run "sudo mv #{Path.new_desktop_entry} #{Path.minisip_desktop_entry}", :announce_pwd => false end