diff --git a/lib/install/dev.bat b/lib/install/dev.bat new file mode 100644 index 00000000..c16867b9 --- /dev/null +++ b/lib/install/dev.bat @@ -0,0 +1,12 @@ +@echo off + +set gem_installed= + +for /f "delims=" %%a in ('gem list foreman -i') do @set gem_installed=%%a + +if %gem_installed%==false ( + echo "Installing foreman..." + gem install foreman +) + +foreman start -f Procfile.dev %* \ No newline at end of file diff --git a/lib/install/tailwindcss.rb b/lib/install/tailwindcss.rb index 413f86b8..ebc95c67 100644 --- a/lib/install/tailwindcss.rb +++ b/lib/install/tailwindcss.rb @@ -39,10 +39,15 @@ end if Rails.root.join("Procfile.dev").exist? - append_to_file "Procfile.dev", "css: bin/rails tailwindcss:watch\n" + unless Gem.win_platform? + append_to_file "Procfile.dev", "css: bin/rails tailwindcss:watch\n" + else + append_to_file "Procfile.dev", "css: ruby bin/rails tailwindcss:watch\n" + end else say "Add default Procfile.dev" copy_file "#{__dir__}/Procfile.dev", "Procfile.dev" + gsub_file "Procfile.dev", /bin\/rails/, "ruby bin/rails" if Gem.win_platform? say "Ensure foreman is installed" run "gem install foreman" @@ -51,6 +56,7 @@ say "Add bin/dev to start foreman" copy_file "#{__dir__}/dev", "bin/dev" chmod "bin/dev", 0755, verbose: false +copy_file "#{__dir__}/dev.bat", "bin/dev.bat" if Gem.win_platform? say "Compile initial Tailwind build" run "rails tailwindcss:build"