obey RAILS_ENV if given
authorTom Clegg <tom@clinicalfuture.com>
Thu, 20 Jun 2013 16:14:28 +0000 (12:14 -0400)
committerTom Clegg <tom@clinicalfuture.com>
Thu, 20 Jun 2013 16:14:28 +0000 (12:14 -0400)
services/api/script/crunch-dispatch.rb
services/api/script/import_commits.rb

index f749f22a77ceef47b6c85833ea9175a804ad565f..9e7097e98e5a7c251e59e0940fd663a57cd8a02f 100755 (executable)
@@ -11,7 +11,7 @@ $signal = {}
   end
 end
 
-ENV["RAILS_ENV"] = ARGV[0] || "development"
+ENV["RAILS_ENV"] = ARGV[0] || ENV["RAILS_ENV"] || "development"
 
 require File.dirname(__FILE__) + '/../config/boot'
 require File.dirname(__FILE__) + '/../config/environment'
index 6c3221992aff6807e2230f79d3e1f9d9724840c3..80c574892ca4d502ec4de122f389a40211b36663 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env ruby
 
-ENV["RAILS_ENV"] = ARGV[0] || "development"
+ENV["RAILS_ENV"] = ARGV[0] || ENV["RAILS_ENV"] || "development"
 
 require File.dirname(__FILE__) + '/../config/boot'
 require File.dirname(__FILE__) + '/../config/environment'