Don't exit when "sh" fails

When 'rake watch:deploy:local' is being used, do not exit when
compilation fails but instead wait for a fix to be applied, and then
re-compile the site.
This commit is contained in:
0x1eef 2022-12-28 03:40:49 -03:00
parent 728b10e524
commit 7a27036425

View file

@ -30,7 +30,7 @@ end
namespace :watch do namespace :watch do
desc "Watch for changes (server task)" desc "Watch for changes (server task)"
task :server do task :server do
Bundler.with_unbundled_env { sh "rake build" } Bundler.with_unbundled_env { Process.wait spawn("rake build") }
Listen.to(File.join(Dir.getwd, "src")) do Listen.to(File.join(Dir.getwd, "src")) do
Bundler.with_unbundled_env { sh "rake build" } Bundler.with_unbundled_env { sh "rake build" }
end.start end.start
@ -40,7 +40,7 @@ namespace :watch do
namespace :deploy do namespace :deploy do
desc "Watch for changes (deploy:local task)" desc "Watch for changes (deploy:local task)"
task :local do task :local do
Bundler.with_unbundled_env { sh "rake deploy:local" } Bundler.with_unbundled_env { Process.wait spawn("rake deploy:local") }
Listen.to(File.join(Dir.getwd, "src")) do Listen.to(File.join(Dir.getwd, "src")) do
Bundler.with_unbundled_env { sh "rake deploy:local" } Bundler.with_unbundled_env { sh "rake deploy:local" }
end.start end.start