aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/tasks/actiontext.rake15
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/tasks/actiontext.rake b/lib/tasks/actiontext.rake
index e73ed34691..6ec30f86e7 100644
--- a/lib/tasks/actiontext.rake
+++ b/lib/tasks/actiontext.rake
@@ -5,7 +5,7 @@ namespace :action_text do
Rake::Task["install:migrations"].clear_comments
desc "Copy over the migration, stylesheet, and JavaScript files"
- task install: %w( environment copy_migrations copy_stylesheet copy_fixtures )
+ task install: %w( environment copy_migrations copy_stylesheet copy_fixtures yarn_add )
task :copy_migrations do
Rake::Task["active_storage:install:migrations"].invoke
@@ -17,9 +17,7 @@ namespace :action_text do
STYLESHEET_APP_PATH = Rails.root.join("app/assets/stylesheets/actiontext.css")
task :copy_stylesheet do
- if File.exist?(STYLESHEET_APP_PATH)
- puts "Won't copy Action Text stylesheet as it already exists"
- else
+ unless File.exist?(STYLESHEET_APP_PATH)
FileUtils.cp STYLESHEET_TEMPLATE_PATH, STYLESHEET_APP_PATH
end
end
@@ -29,11 +27,14 @@ namespace :action_text do
FIXTURE_APP_PATH = FIXTURE_APP_DIR_PATH.join("rich_texts.yml")
task :copy_fixtures do
- if File.exist?(FIXTURE_APP_PATH)
- puts "Won't copy Action Text fixtures as it already exists"
- else
+ unless File.exist?(FIXTURE_APP_PATH)
FileUtils.mkdir FIXTURE_APP_DIR_PATH
FileUtils.cp FIXTURE_TEMPLATE_PATH, FIXTURE_APP_PATH
end
end
+
+ task :yarn_add do
+ # FIXME: Replace with release version on release
+ system "yarn add https://github.com/basecamp/actiontext"
+ end
end