jmod - quick jump to a module

This commit is contained in:
Adolfo Perez Alvarez 2022-09-07 11:54:31 +02:00
parent 519752ecd1
commit 7a85d24714
1 changed files with 15 additions and 0 deletions

15
jmod Normal file
View File

@ -0,0 +1,15 @@
function jmod
{
(( $# != 1 )) && return 64
local m=$(jr && pwd)/modules/apps
local d=$(find $m -maxdepth 2 -mindepth 2 -type d -iregex ".*/.*$1$")
[[ -z $d ]] && return 1
if [[ $(echo $d | wc -w) > 1 ]]
then
select d in $d
do
break
done
fi
echo ${d##*/} && cd $d
}