diff --git a/app/controllers/admin/module_store_controller.rb b/app/controllers/admin/module_store_controller.rb index 44fb040a..d5ef07b4 100644 --- a/app/controllers/admin/module_store_controller.rb +++ b/app/controllers/admin/module_store_controller.rb @@ -18,7 +18,8 @@ class Admin::ModuleStoreController < OrbitBackendController module_app_name = downloaded_file_name.split(/(.zip)/).first #check if the directory exists or not - if Dir.exists?("#{Rails.root}/vendor/built_in_modules/#{module_app_name}") + @module_status = Dir.exists?("#{Rails.root}/vendor/built_in_modules/#{module_app_name}") + if @module_status.eql?(true) flash[:notice] = "This module is already installed" else download_extension(download_link, downloaded_file_name,module_app_name) @@ -42,8 +43,6 @@ class Admin::ModuleStoreController < OrbitBackendController puts %x(unzip "#{downloaded_file_name}") puts %x(mv #{module_app_name} "#{Rails.root}/vendor/built_in_modules/") puts %x(rm "#{downloaded_file_name}") - - Rails.logger.info"@@@@@@@@"+Dir.exists?("#{Rails.root}/vendor/built_in_modules/location").inspect site_restart end end \ No newline at end of file diff --git a/app/views/admin/module_store/index.html.erb b/app/views/admin/module_store/index.html.erb index d6be7adb..b7ae9d30 100644 --- a/app/views/admin/module_store/index.html.erb +++ b/app/views/admin/module_store/index.html.erb @@ -45,7 +45,17 @@ <%= extension["description"].html_safe%> <%= link_to 'Read More', admin_module_store_show_path(extension["_slugs"][0]) %>