Merge pull request #31646 from yrashk/30645-fish

fish-foreign-env: suppress additional harmless warnings
This commit is contained in:
Orivej Desh 2017-11-16 21:27:07 +00:00 committed by GitHub
commit c8aa1483b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 6 deletions

View File

@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
-i $out/share/fish-foreign-env/functions/*
'';
patches = [ ./hide-path-warnings.patch ];
patches = [ ./suppress-harmless-warnings.patch ];
meta = with stdenv.lib; {
description = "A foreign environment interface for Fish shell";

View File

@ -1,16 +1,23 @@
diff --git a/functions/fenv.apply.fish b/functions/fenv.apply.fish
index 34a25e3..6837e7f 100644
index 34a25e3..3d94135 100644
--- a/functions/fenv.apply.fish
+++ b/functions/fenv.apply.fish
@@ -30,8 +30,9 @@ function fenv.apply
@@ -27,11 +27,17 @@ function fenv.apply
for variable in $variables
set key (echo $variable | sed 's/=.*//')
set value (echo $variable | sed 's/[^=]*=//')
+ set ignore PATH _
if test "$key" = 'PATH'
set value (echo $value | tr ':' '\n')
end
- set -g -x $key $value
+ if contains $key $ignore
+ set -g -x $key $value ^/dev/null
+ else
+ set -g -x $key $value
end
-
- set -g -x $key $value
+ end
+
end
end