On installation, fix the prefix used in the script.
[embrace.git] / bin / embrace
index 88a0b918d899796720e7a71ec6236b061dcd4cd5..f6616ea70480a9fa8f8c07468c8c3516aa19367c 100755 (executable)
@@ -17,6 +17,7 @@
 # along with this program; if not, write to the Free Software Foundation,
 # Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
 
+require "evas"
 require "ecore"
 require "ecore_x"
 require "ecore_evas"
@@ -25,10 +26,11 @@ require "yaml"
 require "embrace/imap"
 
 PKG_NAME = "embrace"
-DATADIR = "/usr/local/share/#{PKG_NAME}/"
+PREFIX = nil
+DATADIR = "#{PREFIX || "/usr/local"}/share/#{PKG_NAME}/"
 
 module Embrace
-       VERSION = "0.0.1"
+       VERSION = "0.1.0"
        ICON_FILE = DATADIR + "l33t_MAI_envelope.png"
 
        class ZeroToOneAnimator < Ecore::Animator
@@ -393,9 +395,7 @@ module Embrace
 
                private
                def on_timer
-                       return unless @server.nil?
-
-                       @server = IMAP::Session.new(@config)
+                       @server ||= IMAP::Session.new(@config)
 
                        true
                end