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=216426be0e9014cb38f4b3a76333430bdbc6535e;hp=a8fc12f156252cdffc185ca5ddb0a91692dbbe74;hb=1730f48f02f596ea214aab12466dd6471a2990d7;hpb=fe8aa69b67d4085cc1c7a543a704c26f535a32b8 diff --git a/lib/local/lib.pm b/lib/local/lib.pm index a8fc12f..216426b 100644 --- a/lib/local/lib.pm +++ b/lib/local/lib.pm @@ -442,6 +442,16 @@ sub wrap_powershell_output { return $out || " \n"; } +sub build_fish_env_declaration { + my ($class, $name, $args) = @_; + my $value = $class->_interpolate($args, '$%s', '"', '\\%s'); + if (!defined $value) { + return qq{set -e $name;\n}; + } + $value =~ s/$_path_sep/ /g; + qq{set -x $name $value;\n}; +} + sub _interpolate { my ($class, $args, $var_pat, $escape, $escape_pat) = @_; return @@ -557,6 +567,7 @@ sub guess_shelltype { for ($shellbin) { return /csh$/ ? 'csh' + : /fish/ ? 'fish' : /command(?:\.com)?$/i ? 'cmd' : /cmd(?:\.exe)?$/i ? 'cmd' : /4nt(?:\.exe)?$/i ? 'cmd'