mirror of
https://github.com/tonydamage/nux-env.git
synced 2025-12-11 13:24:28 +01:00
nuxfs: Added support for invoking in nested dir.
Signed-off-by: Tony Tkacik <tonydamage@gmail.com>
This commit is contained in:
parent
850bf0d339
commit
d40b82bfc8
3 changed files with 50 additions and 12 deletions
|
|
@ -33,3 +33,16 @@ function nuxfs.dir.push {
|
|||
function nuxfs.file.exists {
|
||||
test -e "$1" -o -h "$1";
|
||||
}
|
||||
|
||||
function nuxfs.closest {
|
||||
cmd=$1;
|
||||
cdir=$(pwd);
|
||||
nux.log trace "Searching in: " $cdir;
|
||||
until [ -e "$cdir/$1" -o "$cdir" == "/" ]; do
|
||||
cdir=$(dirname "$cdir");
|
||||
nux.log trace "Searching in: " $cdir;
|
||||
done;
|
||||
if [ -e "$cdir/$1" ]; then
|
||||
echo "$cdir/$1";
|
||||
fi
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue