From 4873ab4008c7322984f415b8d418721e27ce8016 Mon Sep 17 00:00:00 2001 From: Matt Polito Date: Mon, 21 Oct 2024 16:26:41 -0400 Subject: [PATCH] fix: Use Tailwindcss::Ruby executable --- lib/tasks/tailwind.rake | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/tasks/tailwind.rake b/lib/tasks/tailwind.rake index 2da3905e0..b31d20e62 100644 --- a/lib/tasks/tailwind.rake +++ b/lib/tasks/tailwind.rake @@ -3,18 +3,26 @@ require "tailwindcss-rails" namespace :spina do namespace :tailwind do def spina_tailwind_compile_command - "#{Tailwindcss::Engine.root.join("exe/tailwindcss")} -i #{Spina::Engine.root.join("app/assets/stylesheets/spina/application.tailwind.css")} -o #{Rails.root.join("app/assets/builds", "spina/tailwind.css")} -c #{Rails.root.join("app/assets/config/spina/tailwind.config.js")}" + [ + Tailwindcss::Ruby.executable, + "-i", Spina::Engine.root.join("app/assets/stylesheets/spina/application.tailwind.css").to_s, + "-o", Rails.root.join("app/assets/builds/spina/tailwind.css").to_s, + "-c", Rails.root.join("app/assets/config/spina/tailwind.config.js").to_s, + ] end desc "Build your Tailwind CSS" task build: :environment do Rails::Generators.invoke("spina:tailwind_config", ["--force"]) - system spina_tailwind_compile_command + command = spina_tailwind_compile_command + system *command end task watch: :environment do Rails::Generators.invoke("spina:tailwind_config", ["--force"]) - system "#{spina_tailwind_compile_command} -w" + command = spina_tailwind_compile_command + command << "-w" + system *command end end end