#!/usr/bin/env nuxr-nuxsh nux.use nux/fs CLOSEST=$(nux.fs.closest .foldy.nuxsh) ## list:: List Available foldy integrated directories @command list { #nux.fs.info "Listing foldy files in $CLOSEST" find -iname ".foldy.nuxsh" | while read line; do echo "${line%.foldy.nuxsh}" done } ## exec:: [] ## Run foldy command in directory. @command run path command { (cd $path; foldy $command "$@" ) } @command help.additional { echo "Tasks defined in ${NC_White}$CLOSEST${NC_No}" echo "Custom Help" nux.help.comment "$CLOSEST" } @namespace nuxr.run. { function :additional TASK { if [[ -f "$CLOSEST" ]]; then nux.log debug Loading sources fron "$CLOSEST" nux.nuxsh.use "$CLOSEST" fi if nux.check.function task.$TASK; then nux.log debug "Running task: $TASK"; nux.log debug "Working dir: $(pwd)" task.$TASK "$@" # Runs task else echo "$NUX_SCRIPTNAME: Unrecognized task '$TASK' not available." echo "Try '$NUX_SCRIPTNAME help' for more information." return -1 fi } }