Skip to content

Instantly share code, notes, and snippets.

@cj

cj/Yah.pm Secret

Created September 27, 2014 01:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cj/f00c8087a8e6cb56ea14 to your computer and use it in GitHub Desktop.
Save cj/f00c8087a8e6cb56ea14 to your computer and use it in GitHub Desktop.
if($self->mode eq 'development' || $self->mode eq 'test') {
my $env = Mojo::Asset::File->new(path => 'env.sh')->get_chunk;
my $mode_env = Mojo::Asset::File->new(path => "env.$mode.sh");
my $mode = $self->mode;
if($mode_env->size > 0) {
$env .= $mode_env->get_chunk;
}
foreach my $file (split('\n', $env)){
my($key, $value) = split('=', $file);
$ENV{$key} = $value;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment