1
0
Fork 0
mirror of https://github.com/ryanccn/flake.git synced 2025-12-06 16:10:45 +01:00

feat(fish): add where function

This commit is contained in:
Ryan Cao 2023-07-27 19:57:27 +08:00
parent dbce5bf0d8
commit 2d758cb766
Signed by: ryanccn
SSH key fingerprint: SHA256:NtP/BlVhoQq4xU6BEcZeT8nIPvHntkJ3lIc2yB+F09E

View file

@ -6,6 +6,7 @@ in {
programs.fish = {
enable = true;
inherit shellAbbrs shellAliases;
functions = {
take = ''
set dir $argv[1]
@ -16,6 +17,14 @@ in {
mkdir "$dir"
cd "$dir"
'';
where = ''
set name $argv[1]
for p in $PATH
if test -e "$p/$name"
echo "$p/$name"
end
end
'';
};
};