mirror of
https://github.com/tonydamage/nux-env.git
synced 2025-12-12 13:34:29 +01:00
foldy: Run commands for all nested foldy definitions
This commit is contained in:
parent
1de6be55f7
commit
a95a906f5a
1 changed files with 15 additions and 4 deletions
19
bin/foldy
19
bin/foldy
|
|
@ -1,16 +1,27 @@
|
||||||
#!/usr/bin/env nuxr-nuxsh
|
#!/usr/bin/env nuxr-nuxsh
|
||||||
nux.use nux/fs
|
nux.use nux/fs
|
||||||
|
|
||||||
CLOSEST=$(nux.fs.closest .foldy.nuxsh)
|
FOLDY_FILE=.foldy.nuxsh
|
||||||
|
CLOSEST=$(nux.fs.closest $FOLDY_FILE)
|
||||||
|
FOLDY_DIR=$(dirname "$CLOSEST")
|
||||||
|
|
||||||
## list:: List Available foldy integrated directories
|
## list:: List Available foldy integrated directories
|
||||||
@command list {
|
@command list {
|
||||||
#nux.fs.info "Listing foldy files in $CLOSEST"
|
#nux.fs.info "Listing foldy files in $CLOSEST"
|
||||||
find -iname ".foldy.nuxsh" | while read line; do
|
find -name $FOLDY_FILE | while read line; do
|
||||||
echo "${line%.foldy.nuxsh}"
|
echo "${line%.foldy.nuxsh}"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
## all:: <command> [<args>]
|
||||||
|
## Run foldy command in all descendant foldy managed directories.
|
||||||
|
@command all command {
|
||||||
|
find -name $FOLDY_FILE | while read line; do
|
||||||
|
dir="${line%.foldy.nuxsh}"
|
||||||
|
nux.fs.info $dir Running foldy $command
|
||||||
|
task.run "$dir" "$command" "$@"
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
## exec:: <path> <command> [<args>]
|
## exec:: <path> <command> [<args>]
|
||||||
## Run foldy command in directory.
|
## Run foldy command in directory.
|
||||||
|
|
@ -19,8 +30,8 @@ CLOSEST=$(nux.fs.closest .foldy.nuxsh)
|
||||||
}
|
}
|
||||||
|
|
||||||
@command help.additional {
|
@command help.additional {
|
||||||
echo "Tasks defined in ${NC_White}$CLOSEST${NC_No}"
|
echo
|
||||||
echo "Custom Help"
|
echo "Tasks defined in ${NC_White}${CLOSEST%$FOLDY_FILE}${NC_No}:"
|
||||||
nux.help.comment "$CLOSEST"
|
nux.help.comment "$CLOSEST"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue