Permalink
Browse files

Pass ENV to templates.

  • Loading branch information...
1 parent c1b8e39 commit a7ba57de5ba6e55e1849a7d586700be1eae3e535 yegg committed Dec 31, 2012
Showing with 9 additions and 3 deletions.
  1. +2 −2 lib/DDG/App/Publisher.pm
  2. +7 −1 lib/DDG/Publisher/File.pm
View
4 lib/DDG/App/Publisher.pm
@@ -65,8 +65,8 @@ sub run {
# or from command line.
#
- warn qq(ENV DDG_MAX_CSS $ENV{DDG_MAX_CSS});
- warn qq(ENV DDG_MAX_JS $ENV{DDG_MAX_JS});
+# warn qq(ENV DDG_MAX_CSS $ENV{DDG_MAX_CSS});
+# warn qq(ENV DDG_MAX_JS $ENV{DDG_MAX_JS});
my $target = @ARGV
? shift @ARGV
View
8 lib/DDG/Publisher/File.pm
@@ -187,9 +187,15 @@ sub _build_content {
#
%vars = ( %vars, $self->code->($self,\%vars) );
+ # 2012.12.31 need environment variables to capture the max js/css.
+ %vars = ( %vars, 'ENV', \%ENV );
+
# explicit getting out no_base for template decision later
my $no_base = defined $vars{no_base} && $vars{no_base};
+# use Data::Dumper;
+# warn Dumper($vars{'ENV'});
+
#
# Gathering the save data for the data files generation
#
@@ -212,4 +218,4 @@ sub _build_content {
return $self->dir->site->template_engine->render($no_base ? $self->template : 'base.tx',\%vars);
}
-1;
+1;

0 comments on commit a7ba57d

Please sign in to comment.