if fetch(:foo_var,nil) #something that needs a foo_var end This checks and returns the cap foo_var variable if not set returns nil, and it doesn't change or define the variable.
On Jul 11, 2013, at 9:22 AM, Simone Fumagalli <simone.fumaga...@gmail.com> wrote: > Hello. I'm new to Capistrano > > I'm trying to write my first post task but I've a problem checking if a var > is defined or not. > I've a multistage setup. For the staging environment the variable foo_var is > defined for the prod environment is not. > > Here my task https://gist.github.com/hpatoio/5976877 > > Environment info > > - rvm 1.21.5 (stable) > - ruby 2.0.0p247 (2013-06-27 revision 41674) [i686-linux] > - Capistrano v2.15.4 > > Ideas ? > > Thanks > > -- > Simone > -- > -- > * You received this message because you are subscribed to the Google Groups > "Capistrano" group. > * To post to this group, send email to capistrano@googlegroups.com > * To unsubscribe from this group, send email to > capistrano+unsubscr...@googlegroups.com For more options, visit this group at > http://groups.google.com/group/capistrano?hl=en > --- > You received this message because you are subscribed to the Google Groups > "Capistrano" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to capistrano+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > > -- -- * You received this message because you are subscribed to the Google Groups "Capistrano" group. * To post to this group, send email to capistrano@googlegroups.com * To unsubscribe from this group, send email to capistrano+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/capistrano?hl=en --- You received this message because you are subscribed to the Google Groups "Capistrano" group. To unsubscribe from this group and stop receiving emails from it, send an email to capistrano+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.