Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Set the app env in ~/.zshenv.

  • Loading branch information...
commit 5a18bd823d2e6ad5b2cfea011bcc353d2c625bca 1 parent 5d6562f
@benhoskings benhoskings authored
Showing with 17 additions and 0 deletions.
  1. +16 −0 env.rb
  2. +1 −0  provision.rb
View
16 env.rb
@@ -0,0 +1,16 @@
+dep 'app env vars set', :env do
+ requires [
+ 'env var set'.with('RACK_ENV', env),
+ 'env var set'.with('RAILS_ENV', env),
+ 'env var set'.with('NODE_ENV', env)
+ ]
+end
+
+dep 'env var set', :key, :value do
+ met? {
+ login_shell("echo $#{key}") == value
+ }
+ meet {
+ "~/.zshenv".p.append("export #{key}=#{value}\n")
+ }
+end
View
1  provision.rb
@@ -142,6 +142,7 @@ def remote_babushka dep_spec, args = {}
dep 'app provisioned', :env, :domain, :app_user, :app_root, :key do
requires [
+ "app env vars set".with(env),
"#{app_user} app".with(env, domain, app_user, app_root, key)
]
end
Please sign in to comment.
Something went wrong with that request. Please try again.