X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2Flocal%2Flib.pm;h=3b8869a7f0a1c99ba79a9700dcec1b029bbc7589;hb=c8d004f4107a818b322ea74e2d5c288cc713f73d;hp=172786ac7e1eb69d09183293d797ebb6e79a9448;hpb=a6c35278bb31a57001e74c307a8c839cc140f681;p=p5sagit%2Flocal-lib.git diff --git a/lib/local/lib.pm b/lib/local/lib.pm index 172786a..3b8869a 100644 --- a/lib/local/lib.pm +++ b/lib/local/lib.pm @@ -8,7 +8,7 @@ use 5.006; use File::Spec (); use Config; -our $VERSION = '2.000003'; # 2.0.3 +our $VERSION = '2.000004'; # 2.0.4 $VERSION = eval $VERSION; sub import { @@ -426,7 +426,7 @@ sub build_powershell_env_declaration { my $value = $class->_interpolate($args, '$env:%s', '"', '`%s'); if (!$value) { - return qq{Remove-Item Env:\\$name;\n}; + return qq{Remove-Item -ErrorAction 0 Env:\\$name;\n}; } my $maybe_path_sep = qq{\$(if("\$env:$name"-eq""){""}else{"$_path_sep"})}; @@ -554,12 +554,12 @@ sub guess_shelltype { for ($shellbin) { return - /csh/ ? 'csh' - : /command\.com/i ? 'cmd' - : /cmd\.exe/i ? 'cmd' - : /4nt\.exe/i ? 'cmd' - : /powershell\.exe/i ? 'powershell' - : 'bourne'; + /csh$/ ? 'csh' + : /command(?:\.com)?$/i ? 'cmd' + : /cmd(?:\.exe)?$/i ? 'cmd' + : /4nt(?:\.exe)?$/i ? 'cmd' + : /powershell(?:\.exe)?$/i ? 'powershell' + : 'bourne'; } }