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:
parent
dbce5bf0d8
commit
2d758cb766
1 changed files with 9 additions and 0 deletions
|
|
@ -6,6 +6,7 @@ in {
|
||||||
programs.fish = {
|
programs.fish = {
|
||||||
enable = true;
|
enable = true;
|
||||||
inherit shellAbbrs shellAliases;
|
inherit shellAbbrs shellAliases;
|
||||||
|
|
||||||
functions = {
|
functions = {
|
||||||
take = ''
|
take = ''
|
||||||
set dir $argv[1]
|
set dir $argv[1]
|
||||||
|
|
@ -16,6 +17,14 @@ in {
|
||||||
mkdir "$dir"
|
mkdir "$dir"
|
||||||
cd "$dir"
|
cd "$dir"
|
||||||
'';
|
'';
|
||||||
|
where = ''
|
||||||
|
set name $argv[1]
|
||||||
|
for p in $PATH
|
||||||
|
if test -e "$p/$name"
|
||||||
|
echo "$p/$name"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue