fishPlugins.foreign-env: 0-unstable-2020-02-09 -> 0-unstable-2023-08-23 (#475471)

This commit is contained in:
Aleksana
2026-01-01 10:15:11 +00:00
committed by GitHub
2 changed files with 9 additions and 36 deletions

View File

@@ -1,36 +1,32 @@
{
bash,
lib,
buildFishPlugin,
fetchFromGitHub,
gnused,
bash,
coreutils,
}:
buildFishPlugin {
pname = "foreign-env";
version = "0-unstable-2020-02-09";
version = "0-unstable-2023-08-23";
src = fetchFromGitHub {
owner = "oh-my-fish";
repo = "plugin-foreign-env";
rev = "dddd9213272a0ab848d474d0cbde12ad034e65bc";
sha256 = "00xqlyl3lffc5l0viin1nyp819wf81fncqyz87jx8ljjdhilmgbs";
rev = "7f0cf099ae1e1e4ab38f46350ed6757d54471de7";
hash = "sha256-4+k5rSoxkTtYFh/lEjhRkVYa2S4KEzJ/IJbyJl+rJjQ=";
};
patches = [ ./suppress-harmless-warnings.patch ];
preInstall = ''
sed -e "s|sed|${gnused}/bin/sed|" \
-e "s|bash|${bash}/bin/bash|" \
-e "s|\| tr|\| ${coreutils}/bin/tr|" \
-i functions/*
sed -i -e "s|bash|${lib.getExe bash}|" functions/fenv.main.fish
'';
meta = {
description = "Foreign environment interface for Fish shell";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ jgillich ];
maintainers = with lib.maintainers; [
jgillich
prince213
];
platforms = with lib.platforms; unix;
};
}

View File

@@ -1,23 +0,0 @@
diff --git a/functions/fenv.apply.fish b/functions/fenv.apply.fish
index 34a25e3..3d94135 100644
--- a/functions/fenv.apply.fish
+++ b/functions/fenv.apply.fish
@@ -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 2>/dev/null
+ else
+ set -g -x $key $value
+ end
+
end
end