X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2Flocal-lib.git;a=blobdiff_plain;f=lib%2Flocal%2Flib.pm;h=68baba797153836b26bf6a2948bcdd1057a8b38e;hp=f1a6dd682dede888021ad82a7d57c3777c73c7f6;hb=4e1bf182fbcc68084cabf865cea917a7e1897e68;hpb=f39aa2f9253fa8a04a286d37bb55fa704c2e806c diff --git a/lib/local/lib.pm b/lib/local/lib.pm index f1a6dd6..68baba7 100644 --- a/lib/local/lib.pm +++ b/lib/local/lib.pm @@ -331,6 +331,10 @@ sub environment_vars_string_for { } $out .= $self->$build_method($name, $value); } + my $wrap_method = 'wrap_' . $self->shelltype . '_output'; + if ($self->can($wrap_method)) { + return $self->$wrap_method($out); + } return $out; } @@ -360,8 +364,12 @@ sub build_powershell_env_declaration { my ($class, $name, $args) = @_; my $value = $class->_interpolate($args, '$env:', '', '"', '`'); defined $value - ? qq{\$env:$name = "$value"\n} - : "Remove-Item Env:\\$name\n"; + ? qq{\$env:$name = "$value";\n} + : "Remove-Item Env:\\$name;\n"; +} +sub wrap_powershell_output { + my ($class, $out) = @_; + return $out || " \n"; }