mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 06:48:47 +08:00
FIX: LOAD_PLUGINS=0 in dev/prod, warn in plugin:pull_compatible_all (#15537)
The `plugin:pull_compatible_all` task is intended to take incompatible plugins and downgrade them to an earlier version. Problem is, when running the rake task in development/production environments, the plugins have already been activated. If an incompatible plugin raises an error in `plugin.rb` then the rake task will be unable to start. This commit centralises our LOAD_PLUGINS detection, adds support for LOAD_PLUGINS=0 in dev/prod, and adds a warning to `plugin:pull_compatible_all` if it's run with plugins enabled.
This commit is contained in:
@ -109,6 +109,13 @@ end
|
||||
|
||||
desc 'pull compatible plugin versions for all plugins'
|
||||
task 'plugin:pull_compatible_all' do |t|
|
||||
if GlobalSetting.load_plugins?
|
||||
STDERR.puts <<~TEXT
|
||||
WARNING: Plugins were activated before running `rake plugin:pull_compatible_all`
|
||||
You should prefix this command with LOAD_PLUGINS=0
|
||||
TEXT
|
||||
end
|
||||
|
||||
# Loop through each directory
|
||||
plugins = Dir.glob(File.expand_path('plugins/*')).select { |f| File.directory? f }
|
||||
# run plugin:pull_compatible
|
||||
|
Reference in New Issue
Block a user