From b07072c12b576d96d0544c255e26ca3ea75db220 Mon Sep 17 00:00:00 2001 From: Fil Maj Date: Fri, 4 Feb 2011 11:20:22 -0800 Subject: [PATCH] Fix for ticket 86 (build fail if phonegap-android dir is located under a dir with "lib" in it). Also bug fix in build if config.xml didnt contain an element. --- lib/classic.rb | 2 +- lib/create.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/classic.rb b/lib/classic.rb index 57409d6a..a2c06c0f 100755 --- a/lib/classic.rb +++ b/lib/classic.rb @@ -19,7 +19,7 @@ class Classic end def setup - @android_dir = File.expand_path(File.dirname(__FILE__).gsub('lib','')) + @android_dir = File.expand_path(File.dirname(__FILE__).gsub(/lib$/,'')) @framework_dir = File.join(@android_dir, "framework") @icon = File.join(@www, 'icon.png') unless File.exists?(@icon) @app_js_dir = '' diff --git a/lib/create.rb b/lib/create.rb index eec2c154..868d8817 100644 --- a/lib/create.rb +++ b/lib/create.rb @@ -62,7 +62,7 @@ class Create < Classic # will change the name from the directory to the name element text @name = @config[:name] if @config[:name] # set the icon from the config - @icon = File.join(@www, @config[:icon]) + @icon = File.join(@www, @config[:icon]) if @config[:icon] # sets the app js dir where phonegap.js gets copied @app_js_dir = @config[:js_dir] ? @config[:js_dir] : '' # sets the start page