Skip to content

A platform for community discussion. Free, open, simple.

DEV: Check `RUN_PITCHFORK` in `bin/ember-cli` and `bin/unicorn` (#37813)

David Taylor253ee0c55a78
diff --git a/bin/ember-cli b/bin/ember-cli
index ef567053d95..8b7b4998cea 100755
--- a/bin/ember-cli
+++ b/bin/ember-cli
@@ -93,7 +93,8 @@ if ARGV.include?("-u") || ARGV.include?("--unicorn")
)
end
- unicorn_pid = spawn(unicorn_env, __dir__ + "/unicorn")
+ server_name = ENV["RUN_PITCHFORK"] == "0" ? "unicorn" : "pitchfork"
+ unicorn_pid = spawn(unicorn_env, "#{__dir__}/#{server_name}")
ember_cli_pid = nil
tsc_pid = nil
diff --git a/bin/qunit b/bin/qunit
index eedc118684e..d5c78914966 100755
--- a/bin/qunit
+++ b/bin/qunit
@@ -375,7 +375,7 @@ class QunitRunner
puts "[dry-run] skipping unicorn startup"
else
unicorn_pid =
- Process.spawn(unicorn_env, File.join(rails_root, "bin", "unicorn"), pgroup: true)
+ Process.spawn(unicorn_env, File.join(rails_root, "bin", "pitchfork"), pgroup: true)
end
wait_for_rails_server(@rails_port)
yield
diff --git a/bin/unicorn b/bin/unicorn
index eaa04f761f5..2a8eb200d83 100755
--- a/bin/unicorn
+++ b/bin/unicorn
@@ -1,6 +1,11 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
+if ENV["RUN_PITCHFORK"] != "0"
+ STDERR.puts "[bin/unicorn] Running bin/pitchfork. Use RUN_PITCHFORK=0 to run unicorn instead."
+ exec File.expand_path("pitchfork", __dir__), *ARGV
+end
+
require "pathname"
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", Pathname.new(__FILE__).realpath)