diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2017-03-03 18:04:19 +0000 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2017-03-10 16:53:15 +0000 |
commit | 45186b5f25cc6ece26c5d7d92a78ab2b75f6d05b (patch) | |
tree | 40986b5c51bfc18d98257446a0ccfdb98d6d1b4d | |
parent | a91d9562c6c0ec836f10290df779e2012f18ddec (diff) |
Set up correct environment in cobrand PO script.
Uses the same environment as gettext-extract.
-rwxr-xr-x | bin/generate_cobrand_po | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/bin/generate_cobrand_po b/bin/generate_cobrand_po index 1770de7c2..8e62230ae 100755 --- a/bin/generate_cobrand_po +++ b/bin/generate_cobrand_po @@ -13,14 +13,22 @@ the main FixMyStreet po files =cut -my $cobrand = shift; +use File::Basename qw(dirname); +use File::Spec; +my $cobrand = shift; die "Please provide a cobrand name\n" unless $cobrand; -my $cobrand_lc = lc( $cobrand ); +my $d = dirname(dirname(File::Spec->rel2abs($0))); +chdir $d; -my $PO = "locale/$cobrand.po"; +# Install required code if needed +system("vendor/bin/carton install --path local-gettext --cpanfile locale/cpanfile --deployment"); +$ENV{PATH} = "local-gettext/bin:$ENV{PATH}"; +$ENV{PERL5LIB} = "local-gettext/lib/perl5:local/lib/perl5"; +my $cobrand_lc = lc( $cobrand ); +my $PO = "locale/$cobrand.po"; my $cobrand_module = "perllib/FixMyStreet/Cobrand/$cobrand.pm"; my $web_templates = "templates/web/$cobrand_lc/"; |