aboutsummaryrefslogtreecommitdiffstats
path: root/lib/tasks/install.rake
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2018-12-13 16:34:02 -0800
committerDavid Heinemeier Hansson <david@loudthinking.com>2018-12-13 16:34:02 -0800
commit2c17861470d9d7e63ac60f6782074c9a9491eb4b (patch)
treed2faabfa300e35625fedbfa1a9025b1a637760db /lib/tasks/install.rake
parent2746449085135e6c345b393b0603eea4a7b1a1b4 (diff)
downloadrails-2c17861470d9d7e63ac60f6782074c9a9491eb4b.tar.gz
rails-2c17861470d9d7e63ac60f6782074c9a9491eb4b.tar.bz2
rails-2c17861470d9d7e63ac60f6782074c9a9491eb4b.zip
Add installer
Diffstat (limited to 'lib/tasks/install.rake')
-rw-r--r--lib/tasks/install.rake19
1 files changed, 10 insertions, 9 deletions
diff --git a/lib/tasks/install.rake b/lib/tasks/install.rake
index d5abf60042..cfc06fbb5f 100644
--- a/lib/tasks/install.rake
+++ b/lib/tasks/install.rake
@@ -5,15 +5,16 @@ namespace :action_mailbox do
Rake::Task["install:migrations"].clear_comments
desc "Copy over the migration"
- task install: %w[ environment install:copy_migration active_storage:install ]
+ task install: %w[ environment run_installer copy_migrations ]
- namespace :install do
- task :copy_migration do
- if Rake::Task.task_defined?("action_mailbox:install:migrations")
- Rake::Task["action_mailbox:install:migrations"].invoke
- else
- Rake::Task["app:action_mailbox:install:migrations"].invoke
- end
- end
+ task :run_installer do
+ installer_template = File.expand_path("../templates/installer.rb", __dir__)
+ system "#{RbConfig.ruby} ./bin/rails app:template LOCATION=#{installer_template}"
+ end
+
+ task :copy_migrations do
+ Rake::Task["active_storage:install:migrations"].invoke
+ Rake::Task["railties:install:migrations"].reenable # Otherwise you can't run 2 migration copy tasks in one invocation
+ Rake::Task["action_mailbox:install:migrations"].invoke
end
end