diff --git a/config/environment.rb b/config/environment.rb index 52cdf1628..7dc9a1a5e 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -12,5 +12,14 @@ if Dir.glob(File.join(vendor_plugins_dir, "*")).any? exit 1 end +# Make sure there's no themes in public/themes before starting +public_themes_dir = Rails.public_path.join('themes') +if Dir.glob(File.join(public_themes_dir, "*")).any? + $stderr.puts "Themes in public/themes (#{public_themes_dir}) are no longer allowed. " \ + "Please, put your Redmine themes in the `themes` directory at the root of your " \ + "Redmine directory (#{Rails.root.join('themes')})" + exit 1 +end + # Initialize the Rails application Rails.application.initialize!