bump version
[p5sagit/local-lib.git] / lib / local / lib.pm
index 172786a..3b8869a 100644 (file)
@@ -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';
   }
 }