dmac / fezzik

A light deployment system that takes care of the heavy lifting.
https://rubygems.org/gems/fezzik
MIT License
37 stars 6 forks source link

Reliable way, in Rake, to determine whether we are being run by Fezzik #28

Closed cespare closed 12 years ago

cespare commented 12 years ago

We should define a constant or env variable inside the fez command, so that it is easy to distinguish whether we are being run by Fezzik inside the Rakefile.

The main use case for this is to wrap the Fezzik loading stuff inside a guard which doesn't run if we're using Rake directly.

Right now the current workaround we've been using is

if ENV["fezzik_destination"]
  require "fezzik"
  require "path/to/fez/configuration.rake"
  ...
end

but this doesn't work in some case (for instance, when you run fez -T or anything else that avoids the code path that sets the fezzik_destination env variable.